-
-
Save seansean11/6153177 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Undo previous commit | |
`git revert HEAD^` | |
Modify previous commit message | |
`git commit --amend` | |
Temporarily stash changes | |
`git stash` | |
Restore changes from stash | |
`git stash pop` | |
Delete changes in stash | |
`git stash drop` | |
Delete all stashes | |
`git stash clear` | |
Delete remote branch | |
`git push origin :<branchName>` | |
Add a remote branch | |
`git remote add <remoteName> <gitAddress>` | |
Add a new submodule | |
`git submodule add git@mygithost:repo path/to/dir` | |
Update all the submodules (externals) | |
`git submodule update --init --recursive` | |
Equivalent of svn revert, default is "HEAD" | |
`git reset --hard` | |
Show status with list modified/new/etc files | |
`git status -s` | |
Add remote to existing local rep, and track master | |
`git remote add --track master origin [email protected]:abc/123.git` | |
Show a single line log | |
`git log --singleline` | |
Rewind head to replay your work on top of it | |
`git rebase <branchName>` | |
Alter commits on current branch (interactive rebase) | |
`git rebase -i HEAD~<number>` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment