Skip to content

Instantly share code, notes, and snippets.

@wiyoe
Last active July 22, 2019 06:35
Show Gist options
  • Select an option

  • Save wiyoe/bbd723751e13aca95a738162ed9f01fe to your computer and use it in GitHub Desktop.

Select an option

Save wiyoe/bbd723751e13aca95a738162ed9f01fe to your computer and use it in GitHub Desktop.
Git tips and tricks
alias gs='git status'
alias gc='git checkout'
alias gl='git pull origin $(git rev-parse --abbrev-ref HEAD)'
alias gp='git push origin $(git rev-parse --abbrev-ref HEAD)'
git checkout - => Switch to previous branch.
alias pb='git checkout -'
git branch -m {{new_branch_name}} => Rename branch.
git reset --hard HEAD => Cancel Staged changes (before committing)
git reset --hard HEAD^
git reset --hard [commit] => İlgili commite kadar siler.
git cherry-pick --abort
git log --oneline
git log --pretty=oneline
git config format.pretty oneline
git status -sb
git fetch remote <branchname> => Fetch a branch from the repository
gitk
Current branch name => git rev-parse --abbrev-ref HEAD
git add -i => Use interactive adding
alias gp='git push'
alias gd='git diff | mate'
alias gau='git add --update'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gb='git branch'
alias gba='git branch -a'
alias gco='git checkout'
alias gcob='git checkout -b'
alias gcot='git checkout -t'
alias gcotb='git checkout --track -b'
alias glog='git log'
alias glogp='git log --pretty=format:"%h %s" --graph'
https://git-scm.com/book/en/v1/Git-Basics-Tips-and-Tricks
git config --get-regexp alias
git config --global alias.co checkout
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.br branch
git config --global alias.hist "log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short"
git config --global alias.type 'cat-file -t'
git config --global alias.dump 'cat-file -p'
alias gs='git status '
alias ga='git add '
alias gb='git branch '
alias gc='git commit'
alias gd='git diff'
alias go='git checkout '
alias gk='gitk --all&'
alias gx='gitx --all'
alias got='git '
alias get='git '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment