My Fugitive Mappings
nmap <leader>gcw :write <bar> :Git add %:p <bar> :Gcommit %:p<CR>
nmap <leader>gpb :execute ":Git push origin " . fugitive#head(0)<CR>
nmap <leader>grb :execute ":Git pull --rebase origin " . fugitive#head(0)CR>
nmap <leader>gc :execute ":Git checkout %"<CR>
These are some small mappings I use with fugitive.
- First writes the file, then addes it then commits it
- Second will push your branch to origin
- Third will rebase your branch from the master
- Last one will checkout the file you are editing. Handy when you need to trash your current edit file and add back the file.
Written by Colin Wood
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Vim
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#