renansigolo
9/5/2018 - 12:18 AM

Git

Snippets for git command line

Git

Select the branch

git checkout [NAME_OF_THE_BRANCH]

Rebase development into the branch checked

git rebase [NAME_OF_THE_BRANCH]

Force Push the branch after rebase

git push -f


Check the history

git log

Checks the history of a file

git log -p [FILE_NAME]

Search for a word in Vim and press n to go directly to the next occurrence

/[WORD_NAME]

Commands

Fetch

Fetch all branches and prune remote branches git fetch --all --prune

Delete Branch

git branch -d branch_name

Discart Changes

git stash save --keep-index --include-untracked

Config

Show all the configs for this git repo git config --list

Ref

https://itnext.io/become-a-git-pro-in-just-one-blog-a-thorough-guide-to-git-architecture-and-command-line-interface-93fbe9bdb395