Giter VIP home page Giter VIP logo

git-cheatsheet's Introduction

Git cheatsheet

GitHub stars GitHub forks GitHub license

git-logo

This document represents the most common Git commands discussed in dwclass.

TO DO:

  • Table of contents
  • Add git cheet sheat with examples
  • Add some pic to show how git works

Contribute

All contributions are welcome:

  • Read the issues, fork the project and do a Pull Request.
  • Request a new topic creating a New issue with the enhancement tag.
  • Find any kind of errors in the cheat sheet and create a New issue with the details or fork the project and do a Pull Request.

FAQ

Why Git

Git tracks the changes you make to files, so you have a record of what has been done, and you can revert to specific versions should you ever need to.

What is the repository and how to organize it

Repositories contain a collection of files of various versions of a Project. it must contain README.md and LICENSE

Git clone

$ git clone https://github.com/mi-alkhamis/git-cheatsheet.git

we use this command to retrieve a copy of a project, in this example, you can get a copy of mine ๐Ÿ˜„

How to sync local repo with the remote one

$ git pull

it gave all changes from the remote repository and write in the local repository

reset vs revert vs checkout

reset: $ git reset COMMIT-NUM restore to COMMIT-NUM and remove ahead commits

revert: $ git revert COMMIT-NUM restore to COMMIT-NUM and make a commitment to remind the path

checkout: $ git checkout COMMIT-NUM to change head to mentioned commit number

rebase vs merge

rebase: $ git rebase order commits by commit number

merge: merge change to make a commit

how to show history

to show history use $ git log

how to show differences with head

$ git diff

Tag, how to use it

use a tag to version the project, to make it easy to get a release from it

$ git tag v1.0

how to contribute to any project

first of all, clone it $ git clone https://github.com/mi-alkhamis/git-cheatsheet.git after making change push it git push

  • NOTE: most projects have How to contribute file, if this file exists, follow the owner's rules to pull the request

What is the branch and how to merge it

make a branch when you work on a bugfix, a new feature, or something like it, and don't want to effort all project, so make a brach $ git branch NAME after making changes merge it $ git merge

License

This project is licensed under the GPL-3.0 License - see the LICENSE file for details.

@dwsclass dws-dev-004-git

git-cheatsheet's People

Contributors

mi-alkhamis avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.