Skip to content

Instantly share code, notes, and snippets.

@user454322
Last active February 8, 2017 07:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save user454322/3cc0e3328939bcbf40bc to your computer and use it in GitHub Desktop.
Save user454322/3cc0e3328939bcbf40bc to your computer and use it in GitHub Desktop.
My git commands
Status between branches
git diff --name-status master..branch_name
Merging while ignoring some files
git merge --no-commit --no-ff branch_name
git reset /path/to/ignored
Tags
git tag -l 'v1.4.2.*'
git tag -a v1.4 -m 'my version 1.4'
git push --tags
Override local
git fetch --all && git reset --hard origin/master
Delete a remote branch
git push origin --delete branch_name
git branch -D macports
Fix a commit message
git commit --amend -m "Fixed commit message"
git push <remote> <branch> --force
#To pipe the output to other commands
git status -s
# Do git pull --rebase stashing and un-stashing
git config pull.rebase true
git config rebase.autoStash true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment