sponsor Vim development Vim logo Vim Book Ad

gitTools : Set of tools to perform git commands.

 script karma  Rating 9/3, Downloaded by 179  Comments, bugs, improvements  Vim wiki

created by
Javier Puigdevall
 
script type
utility
 
description
Allows to launch several git commands from within vim.

This is a port of plugin svnTools, modified to use git instead of svn.

Use :Gith to show the command help.


Abridged command help:

- Info:
    :Giti                 : get current revision info.

- Blame:
    :Gitbl                : get blame of current file.

- Status:
    :Gitst                : show file's status (conceal symbols: X and ?).
    :Gitsta               : show status files (show all symbols).
    :Gitstf               : show current file status.
    :Gitstd               : show current directory status.
    :Gitsth               : show the git status symbols' help.

- Log:
    :Gitl [NUM]           : get subversion log (num. commits, defaults to 3000).
    :Gitls PATTERN [NUM]  : log search pattern (num. commits, defaults to 3000).

- Diff:
    Basic:
      :Gitd PATH          : get diff of changes on the selected path.
      :Gitdf              : get diff of changes on current file.
      :Gitdd              : get diff of changes on current file's directory.
      :Gitda              : get diff of (all) changes on current workind directory.
    Advanced: allows to filter files and binaries.
      :GitD PATH [FLAGS]  : get diff of changes on selected path.
      :GitDD [FLAGS]      : get diff of changes on current file's directory.
      :GitDA [FLAGS]      : get diff of (all) changes on workind directory.
    Gitdvdr              : when placed on a git log and diff file (after Gitr/Gitdd/Gitdf/Gitda)
                           get each file changes vimdiff.

- Vimdiff:
    Basic:
      :Gitvdf             : get vimdiff of current file changes.
      :Gitvd PATH         : get vimdiff of (all) changes on working dir.
      :Gitvdd             : get vimdiff of current file's directory changes.
      :Gitvda             : get vimdiff of (all) files with changes on working dir.
    Advanced: allows to filter files and binaries.
      :GitvD PATH [FLAGS] : get vimdiff of the files with changes on the selected path.
      :GitvDD [FLAGS]     : get vimdiff of the files with changes on current file's directory.
      :GitvDA [FLAGS]     : get vimdiff of the files with changes on working directory.
    FLAGS:
      B:  show binaries.
      NB: skip binaries (default).
      EQ: show equal (default).
      NEQ: skip equal.
      +pattern (keep only files with pattern).
      -pattern (skip all files with pattern).
    Gitvdr REV           : get revision log and open the selected revision changes with vimdiff.

- Revision:
    :Gitr REV             : get diff of selected revision number.
    :Gitsh REV            : show the file on the requested revision number

PENDING: port of reselve and merge commands from svnTools.vim.
 
install details
Minimum version: Vim 7.0+
Recomended version: Vim 8.0+

Install vimball:
download gitTools_0.0.3.vmb
vim gitTools_0.0.3.vmb
:so %
:q
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
gitTools_0.0.6.vmb 0.0.6 2022-10-27 7.0 Javier Puigdevall - New: highlight command help window.
- New: branch delete command Gitbd.
- New: remote branch push command Gitpush.
- New: remote branch delete command Gitpushd.
- New: remote branch pull command Gitpull.
- New: command Gitreme to edit saved remote branches.
gitTools_0.0.5.vmb 0.0.5 2022-10-20 7.0 Javier Puigdevall - Fix: Gitvda, get current branch error.
- New: after commit ask user if merge files should be removed.
- New: command Gitmrm to delete the temporary files (REMOTE, LOCAL, BACKUP)
  from previous merge.
- New: for commands Gitm, Gitd and Gitvd, use git diff to get unmerged or modified
  files instead of git status.
- Fix: issue on merge command Gitm, error opening layout 3A.
- New: command Gitsthmv to move staged changes to stash.
- New: command Gitsthcp to copy staged changes to stash and keep local copy.
- New: command Gitstha to apply changes from stash.
- New: command Gitsthd to delete apply changes from stash.
- Change: rename Gitsh command to Gitsth.
- New: command Gitsw to perform git switch.
- Change: rename command Gita (show branches) to Gitb.
gitTools_0.0.4.vmb 0.0.4 2022-09-26 7.0 Javier Puigdevall - New: on commands Gitda, Gitdf..., add date, hour and branch name to the generated diff file name.
- Fix: commands Gitm, Gitmf, Gitmp used to merge conlicts. Allowed layouts: 1, 2, 3, 4.
- New: command GitcmA to ammend previous commit
- New: command Gitcma to commit all changed files already tracked skipping stage area.
- New: command GitlS to display log changing string.
- New: command Gitla to display log from author.
- New: command Gitrl to display reference log.
- New: command Gitlg to display log graph. Add color highligting with hi.vim plugin.
- Fix: on Gitsh, prevent showing diff path with a/ and b/ prefixes.
- Fix: on Gitr, prevent showing diff path with a/ and b/ prefixes.
- New: on Gitsh display both git list and git list --stat. Add color highlighting.
gitTools_0.0.3.vmb 0.0.3 2022-07-29 7.0 Javier Puigdevall - New: stash command Gitsh [STASH_NUM]
- Fix: perform Gitst on foreground, no need of Jobs.vim.
- New: Gitcm [FILE/DESC] command.
  Launch without arguments to open commit message on first launch, then commit on
  second launch.
- New: Gitds command to show diff with all staged chages.
- New: when callign Gitsta, if current buffer already shows a git status,
  refresh it, do not ask user to open a new window/tab.
gitTools_0.0.2.vmb 0.0.2 2022-07-08 7.0 Javier Puigdevall - New: Gitvdf, do not open new tab when asking for vimdiff of current file.
- Fix: Gitvdf always shows file is not modified.
- New: remove from disk command GitRM.
- New: git move command Gitmv.
- New: remove from disk command Gitrm.
- New: git restore command Gitr.
- New: git unstage command Gitu.
- New: git add command Gita.
- Fix: call again ChooseBranchMenu(), when no branch choosen.
- New: Gitm (git merge) command to show on vimdiff the files with conflicts.
- Fix: Gitvd... and GitVD... commands not showing merge issues.
gitTools_0.0.1.vmb 0.0.1 2022-04-19 7.0 Javier Puigdevall Initial upload
ip used for rating: 34.239.154.240

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
OSDN