This document represents the most common Git commands discussed in dwclass.
- Table of contents
- Add git cheet sheat with examples
- Add some pic to show how git works
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.
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.
Repositories contain a collection of files of various versions of a Project. it must contain README.md and LICENSE
$ 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 ๐
$ git pull
it gave all changes from the remote repository and write in the local repository
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: $ git rebase
order commits by commit number
merge: merge change to make a commit
to show history use $ git log
$ git diff
use a tag to version the project, to make it easy to get a release from it
$ git tag v1.0
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
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
This project is licensed under the GPL-3.0 License - see the LICENSE file for details.
@dwsclass dws-dev-004-git