Created
July 29, 2017 03:48
-
-
Save monkbroc/70a89763ab3ef7b38dd1f870596f75be to your computer and use it in GitHub Desktop.
Useful git commands
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
#!/bin/bash | |
# Save as ~/bin/git-amend then chmod +x ~/bin/git-amend | |
# Usage: `git amend` to silently amend a previous commit | |
git commit --amend --no-edit $* |
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
#!/bin/bash | |
# Save as ~/bin/git-fetch-pr then chmod +x ~/bin/git-fetch-pr | |
# Usage: `git fetch-pr 1` to check out a branch for a GitHub pull request | |
git fetch origin pull/$1/head:pr/$1 && git checkout pr/$1 |
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
#!/bin/bash | |
# Save as ~/bin/git-sunrise then chmod +x ~/bin/git-sunrise | |
# Usage: `git sunrise` to start a new repo! | |
set -xe | |
git init | |
git add . | |
git commit -m ':sunrise:' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment