Last active
August 31, 2015 09:17
-
-
Save erogol/367479f199cbf9dc304f to your computer and use it in GitHub Desktop.
GIT cheatsheet for beginners
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git init | |
git status | |
git add file.ext | |
Add file.ext to tracking of GIT | |
git commit -m "Comment" | |
Say changes are commited | |
git log | |
List act history of the repo | |
git remote add origin https://bla.com/repo_name | |
Add a remote repo location | |
git push -u origin master | |
Push changes to origin (remote server we added) master branch | |
git pull origin master | |
Get latest changes and merge these cahnges with out local repo | |
git diff HEAD | |
See the latest changes of the repo pointed by HEAD pointer | |
git diff --staged | |
See the differences just staged (git add ...) | |
git reset file/path.ext | |
Destage any file from the local repo | |
git checkpout -- file.ext | |
Return the project state when the file.ext is comitted | |
git branch clean_up | |
Create a new branch named clean_up | |
git checkout clean_up | |
Go to branch clean_up | |
git rm '*.ext' | |
Remove all files with the wildcard and their stage informations | |
git checkout master | |
git merge clean_up | |
Go to master branch again and merge the clean_up brnach with the master branch | |
git branch -d clean_up | |
Delete clean_up branch | |
git push | |
Push all changes to remote repo | |
git remote show origin | |
Show the url of remote repo named origin | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment