- change default remote HEAD branch:
git remote set-head origin <branch>
- show local branches:
git branch
- show all branches (even deleted):
git branch --all
- delete local branch:
git branch -d <branch>
- delete remote branch:
git push origin --delete <branch>
orgit push origin :<branch>
- get git commits:
git reflog
- change git name:
git config --global user.name "<name>"
- change git email:
git config --global user.email "<email>"
- show all branchs (including local):
git branch -a
- stage all files:
git add --all
- get all log:
git log
- merge local branches from A to B:
git checkout B
thengit merge A
- checkout status:
git status -s
- get all used commands (since begining of prompt session):
history
- unset Git credentials:
git config --global --unset credential.helper
thengit config --system --unset credential.helper
- disable SSL certificate:
git config http.sslVerify false
orgit -c http.sslVerify=false clone <repo url>
- dynamic submodule update:
git submodule foreach git pull origin master
- delete all local tags:
git tag -d $(git tag -l)
- delete all remote tags:
git push origin --delete $(git tag -l)
- fetch all remote tags:
git fetch
orgit fetch --tags --all
Last active
May 5, 2021 13:58
-
-
Save Devwarlt/8cd66126901ad3e296d1ba155f192168 to your computer and use it in GitHub Desktop.
Useful Git commands
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment