git_cheat_sheet
This is an old revision of the document!
Table of Contents
Git Cheat Sheet
Resources
Try Git
| git init | |
| git status | |
| git add filename.txt | |
| git commit -m “Commit message” | |
| git log | |
| git remote add origin https://whatever.com | |
| git push -u origin master | -u means remember these settings |
| git pull origin master | |
| git diff HEAD | |
| git diff –staged | |
| git reset octofamily/octodog.txt | unstages a file |
| git checkout – octocat.txt | go back to last checkout / undo |
| git branch | ??? Show branches. ??? |
| git branch clean_up | Create new branch. |
| git checkout clean_up | Switch branches. |
| git checkout -b new_branch | Checkout and create branch at the same time. |
| git rm '*.txt' | Remove local files and include the removal in the staging area. |
| git rm -r folder_of_cats | Recursively remove all folders and files from the given directory. |
| git commit -a | Include the deletion of local files to staging area, do the commit. |
| git merge clean_up | |
| git branch -d <branch name> | Delete a branch |
| git branch -D <branch name> | Force delete a branch. Use if branch not merged. |
| git push |
git_cheat_sheet.1486358416.txt.gz · Last modified: 2017/02/06 18:20 (external edit)
