Quick start guide to use vim fugitive:
Glogif current file is opened then show logs for it else show all commit logs.Gstatusgives the status.Gcommitcommit the changes (Note: first you need to stage them, do this with "-").Gwritewrites current file to index i.e to staging area.Greadreverts back the current file to the latest commit state.Gremoveremoves the current file.Gmove <target_path>moves the current file to the given target_pathGblameshows the blame line by line
Browse git objects:
Gedit <branch_name:file_path>shows the file on specified branch_name.Gedit <commit_id>shows the specified commit
Exploring git history:
Geditshows the current file in current state.Glog -10shows only latest 10 logs.Glog --shows all commits in quick fix list.Glog -- %shows all commits only where current file is included.Glog --grep=findme --search for ‘findme’ in all ancestral commit messagesGlog --grep=findme -- %search for ‘findme’ in all ancestral commit messages that touch the currently active fileGgrep <search_string> (branch|commitid)search for the search_string and shows in quick fix list.
Quick fix:
copenopen quick fix windowcnextnext quick fix windowcprevnext quick fix windowcfirstfirst quick fix windowclastlast quick fix window
Notes:
- When a commit is displayed, you can hit "enter" to get tree, blob, commits etc.