mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-08 11:33:47 -05:00
Compare commits
112 Commits
nested/tes
...
v2.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cde670ee81 | ||
|
|
26433842e9 | ||
|
|
eeaadf7255 | ||
|
|
65be0ae749 | ||
|
|
6faf165ef2 | ||
|
|
614e20bb65 | ||
|
|
33b7c1a5b7 | ||
|
|
2a4714335f | ||
|
|
994d781f90 | ||
|
|
a5a75aca92 | ||
|
|
0078c76106 | ||
|
|
e0fa72363a | ||
|
|
a22adef4e0 | ||
|
|
b14434bae0 | ||
|
|
5c2eccd55d | ||
|
|
b1df5f1226 | ||
|
|
b34083549e | ||
|
|
dcecb762b0 | ||
|
|
fa1b8652f1 | ||
|
|
40d78f07de | ||
|
|
63a80f4bfe | ||
|
|
3bdac8b603 | ||
|
|
d87ad99e28 | ||
|
|
b680699450 | ||
|
|
3ac95c4dde | ||
|
|
409b098c93 | ||
|
|
3e0bd86b99 | ||
|
|
9268cb4ea4 | ||
|
|
b82abd5bd5 | ||
|
|
f3ccb0c12e | ||
|
|
5032d9ee72 | ||
|
|
de6c05720c | ||
|
|
d16cd9ced1 | ||
|
|
7c9b87a3c3 | ||
|
|
42daa3183b | ||
|
|
8f60d1d459 | ||
|
|
913fff1cea | ||
|
|
be2ff98db5 | ||
|
|
280bbdb6eb | ||
|
|
366996484e | ||
|
|
7be1f0aef6 | ||
|
|
7195586b79 | ||
|
|
be770419fc | ||
|
|
0648abc018 | ||
|
|
e272080f0d | ||
|
|
2c8d15a790 | ||
|
|
d6e7e20123 | ||
|
|
1d2f150331 | ||
|
|
e5935c1165 | ||
|
|
7ebe5c143d | ||
|
|
c640ee78a8 | ||
|
|
c9b26e20d3 | ||
|
|
79f4a49a94 | ||
|
|
0cb46585ac | ||
|
|
d4df8882c5 | ||
|
|
d5208d494f | ||
|
|
cf248fa66d | ||
|
|
779949c255 | ||
|
|
785bb15745 | ||
|
|
fbf89773b4 | ||
|
|
02a0be79aa | ||
|
|
b2767d204b | ||
|
|
26504eecbd | ||
|
|
0d281a2607 | ||
|
|
b2665cc650 | ||
|
|
c3052fba84 | ||
|
|
4f24757df2 | ||
|
|
eb945e9a11 | ||
|
|
90cbbf5854 | ||
|
|
87c1bda4d5 | ||
|
|
c5c1bd66d8 | ||
|
|
f44845e440 | ||
|
|
245ce889e2 | ||
|
|
444ba9fda5 | ||
|
|
b754bc2031 | ||
|
|
b3a8be6975 | ||
|
|
58ed86e434 | ||
|
|
aac85a268e | ||
|
|
c00ebd75ac | ||
|
|
50cc268d29 | ||
|
|
4865891565 | ||
|
|
3439f999b1 | ||
|
|
6460734b5e | ||
|
|
bdd216827a | ||
|
|
0ac4915cd7 | ||
|
|
841adb49ad | ||
|
|
57afba5bdd | ||
|
|
e1ae9effbc | ||
|
|
19d1c944db | ||
|
|
9315ec694d | ||
|
|
90250785d1 | ||
|
|
099d65826e | ||
|
|
008b957086 | ||
|
|
16c2b7abb9 | ||
|
|
1e3f1103d9 | ||
|
|
9835920a3c | ||
|
|
fd36aa9c61 | ||
|
|
4dd41688cf | ||
|
|
18d6d1ab82 | ||
|
|
9ce67cdc93 | ||
|
|
bf04261080 | ||
|
|
52d180af0a | ||
|
|
14daf094d9 | ||
|
|
ac904e806d | ||
|
|
9f768cd3bc | ||
|
|
09cdce7add | ||
|
|
8851b8fe64 | ||
|
|
cfa485ede7 | ||
|
|
207c643ea4 | ||
|
|
cac2c8ef8e | ||
|
|
a9a22e0e4e | ||
|
|
c3e918072f |
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
.git* export-ignore
|
||||
*.markdown export-ignore
|
||||
@@ -8,8 +8,14 @@ platform issues, and interactions with other plugins. I end up bisecting a
|
||||
lot more than other projects, and thus I'm especially meticulous here about
|
||||
maintaining a clean, readable, history. Squash and force push any requested
|
||||
changes to a pull request. And if your [commit message
|
||||
sucks](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html),
|
||||
I'm not going to accept it. Period.
|
||||
sucks](https://commit.style), I'm not going to accept it. Period.
|
||||
|
||||
If your contribution involves adding a configuration option, you are going to
|
||||
need a very compelling justification for it. Options add a maintenance
|
||||
burden, support burden, and documentation bloat, and oftentimes can be
|
||||
achieved much more simply with a custom map or autocommand. If your option
|
||||
controls an underlying Git command, ask yourself why Git itself does not offer
|
||||
such configuration.
|
||||
|
||||
Beyond that, don't be shy about asking before patching. What takes you hours
|
||||
might take me minutes simply because I have both domain knowledge and a
|
||||
|
||||
@@ -20,7 +20,7 @@ changed, or `o` to open it in a split. When you're done, use `:Gedit`
|
||||
in the historic buffer to go back to the work tree version.
|
||||
|
||||
`:Gmove` does a `git mv` on a file and simultaneously renames the
|
||||
buffer. `:Gremove` does a `git rm` on a file and simultaneously deletes
|
||||
buffer. `:Gdelete` does a `git rm` on a file and simultaneously deletes
|
||||
the buffer.
|
||||
|
||||
Use `:Ggrep` to search the work tree (or any arbitrary commit) with
|
||||
@@ -35,9 +35,15 @@ and you never get any warnings about the file changing outside Vim.
|
||||
making it like `git add` when called from a work tree file and like
|
||||
`git checkout` when called from the index or a blob in history.
|
||||
|
||||
Use `:Gbrowse` to open the current file on GitHub, with optional line
|
||||
range (try it in visual mode!). If your current repository isn't on
|
||||
GitHub, `git instaweb` will be spun up instead.
|
||||
Use `:Gbrowse` to open the current file on the web front-end of your favorite
|
||||
hosting provider, with optional line range (try it in visual mode!). Built-in
|
||||
support is provided for `git instaweb`, and plugins are available for popular
|
||||
providers such as [GitHub][rhubarb.vim], [GitLab][fugitive-gitlab.vim], and
|
||||
[Bitbucket][fubitive.vim].
|
||||
|
||||
[rhubarb.vim]: https://github.com/tpope/vim-rhubarb
|
||||
[fugitive-gitlab.vim]: https://github.com/shumphrey/fugitive-gitlab.vim
|
||||
[fubitive.vim]: https://github.com/tommcdo/vim-fubitive
|
||||
|
||||
Add `%{fugitive#statusline()}` to `'statusline'` to get an indicator
|
||||
with the current branch in (surprise!) your statusline.
|
||||
@@ -60,7 +66,7 @@ If you don't have a preferred installation method, one option is to install
|
||||
and paste:
|
||||
|
||||
cd ~/.vim/bundle
|
||||
git clone git://github.com/tpope/vim-fugitive.git
|
||||
git clone https://github.com/tpope/vim-fugitive.git
|
||||
vim -u NONE -c "helptags vim-fugitive/doc" -c q
|
||||
|
||||
If your Vim version is below 7.2, I recommend also installing
|
||||
@@ -69,24 +75,11 @@ other Git niceties.
|
||||
|
||||
## FAQ
|
||||
|
||||
> I installed the plugin and started Vim. Why don't any of the commands
|
||||
> exist?
|
||||
> Why don't any of the commands exist?
|
||||
|
||||
Fugitive cares about the current file, not the current working
|
||||
directory. Edit a file from the repository.
|
||||
|
||||
> I opened a new tab. Why don't any of the commands exist?
|
||||
|
||||
Fugitive cares about the current file, not the current working
|
||||
directory. Edit a file from the repository.
|
||||
|
||||
> Why is `:Gbrowse` not using the right browser?
|
||||
|
||||
`:Gbrowse` delegates to `git web--browse`, which is less than perfect
|
||||
when it comes to finding the right browser. You can tell it the correct
|
||||
browser to use with `git config --global web.browser ...`. On OS X, for
|
||||
example, you might want to set this to `open`. See `git web--browse --help`
|
||||
for details.
|
||||
Fugitive cares about the current file, not the current working directory.
|
||||
Edit a file from the repository. To avoid the blank window problem, favor
|
||||
commands like `:split` and `:tabedit` over commands like `:new` and `:tabnew`.
|
||||
|
||||
> Here's a patch that automatically opens the quickfix window after
|
||||
> `:Ggrep`.
|
||||
|
||||
@@ -40,10 +40,12 @@ that are part of Git repositories).
|
||||
<CR> |:Gedit|
|
||||
- |:Git| add
|
||||
- |:Git| reset (staged files)
|
||||
cA |:Gcommit| --amend --reuse-message=HEAD
|
||||
a Show alternative format
|
||||
ca |:Gcommit| --amend
|
||||
cc |:Gcommit|
|
||||
cva |:Gcommit| --amend --verbose
|
||||
ce |:Gcommit| --amend --no-edit
|
||||
cw |:Gcommit| --amend --only
|
||||
cva |:Gcommit| --verbose --amend
|
||||
cvc |:Gcommit| --verbose
|
||||
D |:Gdiff|
|
||||
ds |:Gsdiff|
|
||||
@@ -57,6 +59,10 @@ that are part of Git repositories).
|
||||
q close status
|
||||
r reload status
|
||||
S |:Gvsplit|
|
||||
U |:Git| checkout
|
||||
U |:Git| checkout HEAD (staged files)
|
||||
U |:Git| clean (untracked files)
|
||||
U |:Git| rm (unmerged files)
|
||||
|
||||
*fugitive-:Gcommit*
|
||||
:Gcommit [args] A wrapper around git-commit. If there is nothing
|
||||
@@ -72,17 +78,17 @@ that are part of Git repositories).
|
||||
|
||||
*fugitive-:Gmerge*
|
||||
:Gmerge [args] Calls git-merge and loads errors and conflicted files
|
||||
into the quickfix list. Opens a |:Gcommit| style
|
||||
into the |quickfix| list. Opens a |:Gcommit| style
|
||||
split window for the commit message if the merge
|
||||
succeeds. If called during a merge conflict, the
|
||||
conflicted files from the current index are loaded
|
||||
into the quickfix list.
|
||||
into the |quickfix| list.
|
||||
|
||||
*fugitive-:Gpull*
|
||||
:Gpull [args] Like |:Gmerge|, but for git-pull.
|
||||
|
||||
*fugitive-:Gpush*
|
||||
:Gpush [args] Invoke git-push, load the results into the quickfix
|
||||
:Gpush [args] Invoke git-push, load the results into the |quickfix|
|
||||
list, and invoke |:cwindow| to reveal any errors.
|
||||
|:Dispatch| is used if available for asynchronous
|
||||
invocation.
|
||||
@@ -91,27 +97,27 @@ that are part of Git repositories).
|
||||
:Gfetch [args] Like |:Gpush|, but for git-fetch.
|
||||
|
||||
*fugitive-:Ggrep*
|
||||
:Ggrep [args] |:grep| with git-grep as 'grepprg'.
|
||||
:Ggrep[!] [args] |:grep|[!] with git-grep as 'grepprg'.
|
||||
|
||||
*fugitive-:Glgrep*
|
||||
:Glgrep [args] |:lgrep| with git-grep as 'grepprg'.
|
||||
:Glgrep[!] [args] |:lgrep|[!] with git-grep as 'grepprg'.
|
||||
|
||||
*fugitive-:Glog*
|
||||
:Glog [args] Load all previous revisions of the current file into
|
||||
the quickfix list. Additional git-log arguments can
|
||||
the |quickfix| list. Additional git-log arguments can
|
||||
be given (for example, --reverse). If "--" appears as
|
||||
an argument, no file specific filtering is done, and
|
||||
previous commits rather than previous file revisions
|
||||
are loaded.
|
||||
|
||||
:{range}Glog [args] Use git-log -L to load previous revisions of the given
|
||||
range of the current file into the quickfix list. The
|
||||
cursor is positioned on the first line of the first
|
||||
diff hunk for each commit.
|
||||
range of the current file into the |quickfix| list.
|
||||
The cursor is positioned on the first line of the
|
||||
first diff hunk for each commit.
|
||||
|
||||
*fugitive-:Gllog*
|
||||
:Gllog [args] Like |:Glog|, but use the location list instead of the
|
||||
quickfix list.
|
||||
|quickfix| list.
|
||||
|
||||
*fugitive-:Gedit* *fugitive-:Ge*
|
||||
:Gedit [revision] |:edit| a |fugitive-revision|.
|
||||
@@ -177,7 +183,9 @@ that are part of Git repositories).
|
||||
to the right or bottom, depending on 'diffopt' and
|
||||
the width of the window relative to 'textwidth'. Use
|
||||
|do| and |dp| and write to the index file to simulate
|
||||
"git add --patch".
|
||||
"git add --patch". For the three-way diff, there is
|
||||
also d2o and d3o pulling the hunk to the middle from
|
||||
the left or the right window, respectively.
|
||||
|
||||
*fugitive-:Gsdiff*
|
||||
:Gsdiff [revision] Like |:Gdiff|, but always split horizontally.
|
||||
@@ -189,14 +197,23 @@ that are part of Git repositories).
|
||||
:Gmove {destination} Wrapper around git-mv that renames the buffer
|
||||
afterward. The destination is relative to the current
|
||||
directory except when started with a /, in which case
|
||||
it is relative to the work tree. Add a ! to pass -f.
|
||||
it is relative to the work tree. (This is a holdover
|
||||
from before |:Grename| and will be removed.) Add a !
|
||||
to pass -f.
|
||||
|
||||
*fugitive-:Gremove*
|
||||
:Gremove Wrapper around git-rm that deletes the buffer
|
||||
*fugitive-:Grename*
|
||||
:Grename {destination} Like |:Gmove| but operates relative to the parent
|
||||
directory of the current file.
|
||||
|
||||
*fugitive-:Gdelete*
|
||||
:Gdelete Wrapper around git-rm that deletes the buffer
|
||||
afterward. When invoked in an index file, --cached is
|
||||
passed. Add a ! to pass -f and forcefully discard the
|
||||
buffer.
|
||||
|
||||
*fugitive-:Gremove*
|
||||
:Gremove Like :Gdelete, but keep the (now empty) buffer around.
|
||||
|
||||
*fugitive-:Gblame*
|
||||
:Gblame [flags] Run git-blame on the file and open the results in a
|
||||
scroll bound vertical split. You can give any of
|
||||
@@ -221,20 +238,20 @@ that are part of Git repositories).
|
||||
|
||||
*fugitive-:Gbrowse*
|
||||
:Gbrowse Open the current file, blob, tree, commit, or tag
|
||||
in your browser at the upstream hosting provider
|
||||
indicated by the "origin" remote. If a range is
|
||||
given, it is appropriately appended to the URL as an
|
||||
anchor.
|
||||
in your browser at the upstream hosting provider.
|
||||
If a range is given, it is appropriately appended to
|
||||
the URL as an anchor.
|
||||
|
||||
Upstream providers can be added by installing an
|
||||
appropriate Vim plugin. For example, GitHub can be
|
||||
supported by installing rhubarb.vim, available at
|
||||
<https://github.com/tpope/vim-rhubarb>. (Native
|
||||
support for GitHub is currently included, but that is
|
||||
slated to be removed.)
|
||||
<https://github.com/tpope/vim-rhubarb>.
|
||||
|
||||
If no upstream support is available, a local instance
|
||||
of git-instaweb will be started and used instead.
|
||||
The hosting provider is determined by looking at the
|
||||
remote for the current or specified branch and falls
|
||||
back to "origin". In the special case of a "."
|
||||
remote, a local instance of git-instaweb will be
|
||||
started and used.
|
||||
|
||||
:Gbrowse {revision} Like :Gbrowse, but for a given |fugitive-revision|. A
|
||||
useful value here is -, which ties the URL to the
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user