Vim Tips Wiki
Register
(starting out with git under vim)
 
(more than 5 now, plus link to my favored change column plugin :-))
Tag: sourceedit
(13 intermediate revisions by 7 users not shown)
Line 1: Line 1:
  +
{{TipNew
[http://git-scm.com/ git] is a distributed version control tool
 
  +
|id=1614
  +
|previous=1613
  +
|next=1615
  +
|created=February 3, 2009
  +
|complexity=basic
  +
|author=Alecclews
  +
|version=7.0
  +
|subpage=/200902
  +
|category1=VersionControl
  +
|category2=
  +
}}
 
[http://git-scm.com/ Git] is a distributed version control system, which you can use directly from Vim with some help from plugins:
   
  +
*[http://github.com/tpope/vim-fugitive vim-fugitive] (status unknown). Help text is provided.
To use use git from the vim editor two packages are available
 
 
*git-vim (included with Vim 7.1 and later). Provides ftplugin and syntax files for editing various git files (e.g. commit messages).
  +
*{{script|id=2861|text=fastgit.vim}}.
 
*{{script|id=90|text=VCScommand}} plugin that needs to be installed separately. This provides commands to interact with git. Help text is provided.
  +
*{{script|id=3574|text=gitv}} is a 'gitk clone' plugin.
  +
*[https://github.com/jreybert/vimagit vimagit] is an attempt to reproduce the magnificent emacs [https://github.com/magit/magit Magit] plugin to vim. The main idea is to manage all git operations in one single buffer, as efficiently as possible.
  +
*[https://github.com/airblade/vim-gitgutter vim-gitgutter] plugin which shows a "changed" indicator based on git diff in the gutter (sign column). It can also stage or revert hunks. Also see the similar [https://github.com/mhinz/vim-signify Signify] plugin.
   
  +
Git supports using vim diff to resolve merge conflicts
* git-vim shipped with Vim 7.1 and above. Provides syntax files and ftplugins for editing various git files (e.g. commit messages)
 
  +
<pre>
* [http://www.vim.org/scripts/script.php?script_id=90 VCScommand] scripts that needs to be installed separately. These provide commands to interact with git and invoke git. Help text is provided
 
  +
git mergetool -t vimdiff
  +
</pre>
  +
  +
To make it the default merge tool across all your repos
  +
<pre>
  +
git config --global merge.tool vimdiff
  +
</pre>
  +
  +
==See also==
  +
  +
* [http://vim.wikia.com/wiki/Git_grep Git Grep]
  +
  +
* [http://vim.wikia.com/wiki/Always_start_on_first_line_of_git_commit_message Always start on first line of git commit message]
  +
  +
* Additional [http://www.osnews.com/story/21556/Using_Git_with_Vim tips] on Vim and Git by [http://amjith.blogspot.com/ Amjith Ramanujam]
  +
  +
==Comments==

Revision as of 14:49, 7 October 2015

Tip 1614 Printable Monobook Previous Next

created February 3, 2009 · complexity basic · author Alecclews · version 7.0


Git is a distributed version control system, which you can use directly from Vim with some help from plugins:

  • vim-fugitive (status unknown). Help text is provided.
  • git-vim (included with Vim 7.1 and later). Provides ftplugin and syntax files for editing various git files (e.g. commit messages).
  • fastgit.vim.
  • VCScommand plugin that needs to be installed separately. This provides commands to interact with git. Help text is provided.
  • gitv is a 'gitk clone' plugin.
  • vimagit is an attempt to reproduce the magnificent emacs Magit plugin to vim. The main idea is to manage all git operations in one single buffer, as efficiently as possible.
  • vim-gitgutter plugin which shows a "changed" indicator based on git diff in the gutter (sign column). It can also stage or revert hunks. Also see the similar Signify plugin.

Git supports using vim diff to resolve merge conflicts

git mergetool -t vimdiff

To make it the default merge tool across all your repos

git config --global merge.tool vimdiff

See also

Comments