Skip to content

Instantly share code, notes, and snippets.

@salarmehr
Last active February 10, 2020 02:52
Show Gist options
  • Save salarmehr/229d71dfe83f17c874e1a3aa53b729ca to your computer and use it in GitHub Desktop.
Save salarmehr/229d71dfe83f17c874e1a3aa53b729ca to your computer and use it in GitHub Desktop.
Git commands
git branch --merged | egrep -v "(^\*|master|develop)" | xargs git branch -d
git reset HEAD^ # remove commit locally
git push origin +HEAD # force-push the new HEAD commits
#Delete a remote GIT branch
# To delete a remote branch you can use the following command:
git push {remote_name} --delete {branch_name}
git update-index --assume-unchanged {file}
git update-index --skip-worktree {file}
git config --global push.default current
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment