2015-12-15 02:28:02 -05:00
|
|
|
Git
|
|
|
|
===
|
|
|
|
|
|
|
|
Provides nice git aliases and functions.
|
|
|
|
|
[git] Review aliases and README.md
This complements the changes done in the last commit, and also fixes the
`glg` output, and removes the now unnecessary `--date=relative`
parameter from `glG`.
Although I insisted on the `--long-option` format on 8669a4f, I think
`rm -rf` is pretty common and recognizable, so revert to that.
Add missing aliases to README.md, and improve description of existing
ones. The main improvement is trying to be more concise, so instead of
repeating "records changes to the repository" multiple times, simply say
"commits", for example. Also try to use words that match the alias
letters, so for "gcs" say "shows" instead of "displays", for example.
2018-01-11 11:30:20 -05:00
|
|
|
Many thanks to [Sorin Ionescu](https://github.com/sorin-ionescu) for the
|
|
|
|
excellent aliases.
|
2015-12-15 02:28:02 -05:00
|
|
|
|
|
|
|
Aliases
|
|
|
|
-------
|
|
|
|
|
|
|
|
### Git
|
|
|
|
|
|
|
|
- `g` is short for `git`.
|
|
|
|
|
|
|
|
### Branch
|
|
|
|
|
|
|
|
- `gb` lists, creates, renames, and deletes branches.
|
|
|
|
- `gbc` creates a new branch.
|
|
|
|
- `gbl` lists branches and their commits.
|
|
|
|
- `gbL` lists local and remote branches and their commits.
|
[git] Review aliases and README.md
This complements the changes done in the last commit, and also fixes the
`glg` output, and removes the now unnecessary `--date=relative`
parameter from `glG`.
Although I insisted on the `--long-option` format on 8669a4f, I think
`rm -rf` is pretty common and recognizable, so revert to that.
Add missing aliases to README.md, and improve description of existing
ones. The main improvement is trying to be more concise, so instead of
repeating "records changes to the repository" multiple times, simply say
"commits", for example. Also try to use words that match the alias
letters, so for "gcs" say "shows" instead of "displays", for example.
2018-01-11 11:30:20 -05:00
|
|
|
- `gbm` renames a branch.
|
|
|
|
- `gbM` renames a branch even if the new branch name already exists.
|
2015-12-15 02:28:02 -05:00
|
|
|
- `gbs` lists branches and their commits with ancestry graphs.
|
|
|
|
- `gbS` lists local and remote branches and their commits with ancestry
|
|
|
|
graphs.
|
|
|
|
- `gbx` deletes a branch.
|
|
|
|
- `gbX` deletes a branch irrespective of its merged status.
|
|
|
|
|
|
|
|
### Commit
|
|
|
|
|
|
|
|
- `gc` records changes to the repository.
|
[git] Review aliases and README.md
This complements the changes done in the last commit, and also fixes the
`glg` output, and removes the now unnecessary `--date=relative`
parameter from `glG`.
Although I insisted on the `--long-option` format on 8669a4f, I think
`rm -rf` is pretty common and recognizable, so revert to that.
Add missing aliases to README.md, and improve description of existing
ones. The main improvement is trying to be more concise, so instead of
repeating "records changes to the repository" multiple times, simply say
"commits", for example. Also try to use words that match the alias
letters, so for "gcs" say "shows" instead of "displays", for example.
2018-01-11 11:30:20 -05:00
|
|
|
- `gca` commits all modified and deleted files.
|
|
|
|
- `gcm` commits with the given message.
|
|
|
|
- `gco` checks out a branch or paths to the working tree.
|
2015-12-15 02:28:02 -05:00
|
|
|
- `gcO` checks out hunks from the index or the tree interactively.
|
[git] Review aliases and README.md
This complements the changes done in the last commit, and also fixes the
`glg` output, and removes the now unnecessary `--date=relative`
parameter from `glG`.
Although I insisted on the `--long-option` format on 8669a4f, I think
`rm -rf` is pretty common and recognizable, so revert to that.
Add missing aliases to README.md, and improve description of existing
ones. The main improvement is trying to be more concise, so instead of
repeating "records changes to the repository" multiple times, simply say
"commits", for example. Also try to use words that match the alias
letters, so for "gcs" say "shows" instead of "displays", for example.
2018-01-11 11:30:20 -05:00
|
|
|
- `gcf` amends the tip of the current branch reusing the same log message as
|
2015-12-15 02:28:02 -05:00
|
|
|
*HEAD*.
|
|
|
|
- `gcF` amends the tip of the current branch.
|
|
|
|
- `gcp` applies changes introduced by existing commits.
|
|
|
|
- `gcP` applies changes introduced by existing commits without committing.
|
|
|
|
- `gcr` reverts existing commits by reverting patches and recording new
|
|
|
|
commits.
|
|
|
|
- `gcR` removes the *HEAD* commit.
|
[git] Review aliases and README.md
This complements the changes done in the last commit, and also fixes the
`glg` output, and removes the now unnecessary `--date=relative`
parameter from `glG`.
Although I insisted on the `--long-option` format on 8669a4f, I think
`rm -rf` is pretty common and recognizable, so revert to that.
Add missing aliases to README.md, and improve description of existing
ones. The main improvement is trying to be more concise, so instead of
repeating "records changes to the repository" multiple times, simply say
"commits", for example. Also try to use words that match the alias
letters, so for "gcs" say "shows" instead of "displays", for example.
2018-01-11 11:30:20 -05:00
|
|
|
- `gcs` shows one or more objects (blobs, trees, tags and commits).
|
|
|
|
- `gcS` commits with GPG signature.
|
[git] Breaking changes in aliases and functions
Rename `gpS` (mnemonic "pretty-signature") and `glS` ("log-signature")
to `gcv` ("commit-verify") and `glv` ("log-verify") respectivelly,
so `v` is used to verify signatures, and `s`/`S` is used to sign.
Remove `git-commit-lost` and `git-stash-dropped`, as this could be
probably joined into one function that shows all lost commits, including
lost stashes, and also because there seems to be many different ways to
do this, as discussed in https://stackoverflow.com/q/89332/2654518.
An answer worth noting is https://stackoverflow.com/a/6455586/2654518.
If someone is using this, let's discuss on a new solution...
Remove Oh-My-Zsh compatibility from `git-branch-current`, and delete
`git_current_branch`. This compatibility was already partially broken at
c1b02c0, when we also updated the gitster prompt theme. Now this
function fails when in 'detached HEAD' state (is was returning the
commit hash in this state), which is what we would expect from the use
we make of it.
Closes #244
2018-01-11 16:00:05 -05:00
|
|
|
- `gcv` verifies the GPG signature of commits.
|
2015-12-15 02:28:02 -05:00
|
|
|
|
|
|
|
### Conflict
|
|
|
|
|
|
|
|
- `gCl` lists unmerged files.
|
|
|
|
- `gCa` adds unmerged file contents to the index.
|
[git] Review aliases and README.md
This complements the changes done in the last commit, and also fixes the
`glg` output, and removes the now unnecessary `--date=relative`
parameter from `glG`.
Although I insisted on the `--long-option` format on 8669a4f, I think
`rm -rf` is pretty common and recognizable, so revert to that.
Add missing aliases to README.md, and improve description of existing
ones. The main improvement is trying to be more concise, so instead of
repeating "records changes to the repository" multiple times, simply say
"commits", for example. Also try to use words that match the alias
letters, so for "gcs" say "shows" instead of "displays", for example.
2018-01-11 11:30:20 -05:00
|
|
|
- `gCe` executes merge-tool on all unmerged files.
|
2015-12-15 02:28:02 -05:00
|
|
|
- `gCo` checks out our changes for unmerged paths.
|
|
|
|
- `gCO` checks out our changes for all unmerged paths.
|
|
|
|
- `gCt` checks out their changes for unmerged paths.
|
|
|
|
- `gCT` checks out their changes for all unmerged paths.
|
|
|
|
|
|
|
|
### Data
|
|
|
|
|
|
|
|
- `gd` displays information about files in the index and the work tree.
|
|
|
|
- `gdc` lists cached files.
|
|
|
|
- `gdx` lists deleted files.
|
|
|
|
- `gdm` lists modified files.
|
|
|
|
- `gdu` lists untracked files.
|
|
|
|
- `gdk` lists killed files.
|
|
|
|
- `gdi` lists ignored files.
|
|
|
|
|
|
|
|
### Fetch
|
|
|
|
|
|
|
|
- `gf` downloads objects and references from another repository.
|
|
|
|
- `gfc` clones a repository into a new directory.
|
|
|
|
- `gfm` fetches from and merges with another repository or local branch.
|
|
|
|
- `gfr` fetches from and rebases on another repository or local branch.
|
|
|
|
|
|
|
|
### Grep
|
|
|
|
|
|
|
|
- `gg` displays lines matching a pattern.
|
|
|
|
- `ggi` displays lines matching a pattern ignoring case.
|
|
|
|
- `ggl` lists files matching a pattern.
|
|
|
|
- `ggL` lists files that are not matching a pattern.
|
|
|
|
- `ggv` displays lines not matching a pattern.
|
|
|
|
- `ggw` displays lines matching a pattern at word boundary.
|
|
|
|
|
|
|
|
### Index
|
|
|
|
|
|
|
|
- `gia` adds file contents to the index.
|
|
|
|
- `giA` adds file contents to the index interactively.
|
|
|
|
- `giu` adds file contents to the index (updates only known files).
|
|
|
|
- `gid` displays changes between the index and a named commit (diff).
|
|
|
|
- `giD` displays changes between the index and a named commit (word diff).
|
[git] Review aliases and README.md
This complements the changes done in the last commit, and also fixes the
`glg` output, and removes the now unnecessary `--date=relative`
parameter from `glG`.
Although I insisted on the `--long-option` format on 8669a4f, I think
`rm -rf` is pretty common and recognizable, so revert to that.
Add missing aliases to README.md, and improve description of existing
ones. The main improvement is trying to be more concise, so instead of
repeating "records changes to the repository" multiple times, simply say
"commits", for example. Also try to use words that match the alias
letters, so for "gcs" say "shows" instead of "displays", for example.
2018-01-11 11:30:20 -05:00
|
|
|
- `gir` resets the current *HEAD* to the specified state.
|
2015-12-15 02:28:02 -05:00
|
|
|
- `giR` resets the current index interactively.
|
|
|
|
- `gix` removes files/directories from the index (recursively).
|
|
|
|
- `giX` removes files/directories from the index (recursively and forced).
|
|
|
|
|
|
|
|
### Log
|
|
|
|
|
|
|
|
- `gl` displays the log.
|
|
|
|
- `gls` displays the stats log.
|
|
|
|
- `gld` displays the diff log.
|
|
|
|
- `glo` displays the one line log.
|
2018-01-13 17:56:20 -05:00
|
|
|
- `glO` displays the one line log with authors and dates.
|
2015-12-15 02:28:02 -05:00
|
|
|
- `glg` displays the graph log.
|
2016-05-05 06:56:08 -04:00
|
|
|
- `glG` displays the graph log with authors and dates.
|
[git] Breaking changes in aliases and functions
Rename `gpS` (mnemonic "pretty-signature") and `glS` ("log-signature")
to `gcv` ("commit-verify") and `glv` ("log-verify") respectivelly,
so `v` is used to verify signatures, and `s`/`S` is used to sign.
Remove `git-commit-lost` and `git-stash-dropped`, as this could be
probably joined into one function that shows all lost commits, including
lost stashes, and also because there seems to be many different ways to
do this, as discussed in https://stackoverflow.com/q/89332/2654518.
An answer worth noting is https://stackoverflow.com/a/6455586/2654518.
If someone is using this, let's discuss on a new solution...
Remove Oh-My-Zsh compatibility from `git-branch-current`, and delete
`git_current_branch`. This compatibility was already partially broken at
c1b02c0, when we also updated the gitster prompt theme. Now this
function fails when in 'detached HEAD' state (is was returning the
commit hash in this state), which is what we would expect from the use
we make of it.
Closes #244
2018-01-11 16:00:05 -05:00
|
|
|
- `glv` displays the log verifying the GPG signature of commits.
|
2018-01-13 17:56:20 -05:00
|
|
|
- `glc` displays the commit count for each contributor in descending order.
|
2015-12-15 02:28:02 -05:00
|
|
|
|
|
|
|
### Merge
|
|
|
|
|
|
|
|
- `gm` joins two or more development histories together.
|
[git] Review aliases and README.md
This complements the changes done in the last commit, and also fixes the
`glg` output, and removes the now unnecessary `--date=relative`
parameter from `glG`.
Although I insisted on the `--long-option` format on 8669a4f, I think
`rm -rf` is pretty common and recognizable, so revert to that.
Add missing aliases to README.md, and improve description of existing
ones. The main improvement is trying to be more concise, so instead of
repeating "records changes to the repository" multiple times, simply say
"commits", for example. Also try to use words that match the alias
letters, so for "gcs" say "shows" instead of "displays", for example.
2018-01-11 11:30:20 -05:00
|
|
|
- `gmC` performs the merge but does not commit.
|
|
|
|
- `gmF` performs the merge generating a commit even if the merge resolved as a
|
|
|
|
fast-forward.
|
2015-12-15 02:28:02 -05:00
|
|
|
- `gma` aborts the conflict resolution, and reconstructs the pre-merge state.
|
|
|
|
- `gmt` runs the merge conflict resolution tools to resolve conflicts.
|
|
|
|
|
|
|
|
### Push
|
|
|
|
|
|
|
|
- `gp` updates remote refs along with associated objects.
|
[git] Review aliases and README.md
This complements the changes done in the last commit, and also fixes the
`glg` output, and removes the now unnecessary `--date=relative`
parameter from `glG`.
Although I insisted on the `--long-option` format on 8669a4f, I think
`rm -rf` is pretty common and recognizable, so revert to that.
Add missing aliases to README.md, and improve description of existing
ones. The main improvement is trying to be more concise, so instead of
repeating "records changes to the repository" multiple times, simply say
"commits", for example. Also try to use words that match the alias
letters, so for "gcs" say "shows" instead of "displays", for example.
2018-01-11 11:30:20 -05:00
|
|
|
- `gpf` forces a push.
|
|
|
|
- `gpa` pushes all branches.
|
|
|
|
- `gpA` pushes all branches and tags.
|
|
|
|
- `gpt` pushes all tags.
|
|
|
|
- `gpc` pushes the current branch and adds *origin* as an upstream reference
|
|
|
|
for it.
|
|
|
|
- `gpp` pulls and pushes the current branch from *origin* to *origin*.
|
2015-12-15 02:28:02 -05:00
|
|
|
|
|
|
|
### Rebase
|
|
|
|
|
|
|
|
- `gr` forward-ports local commits to the updated upstream head.
|
|
|
|
- `gra` aborts the rebase.
|
|
|
|
- `grc` continues the rebase after merge conflicts are resolved.
|
|
|
|
- `gri` makes a list of commits to be rebased and opens the editor.
|
|
|
|
- `grs` skips the current patch.
|
|
|
|
|
|
|
|
### Remote
|
|
|
|
|
|
|
|
- `gR` manages tracked repositories.
|
|
|
|
- `gRl` lists remote names and their URLs.
|
|
|
|
- `gRa` adds a new remote.
|
|
|
|
- `gRx` removes a remote.
|
|
|
|
- `gRm` renames a remote.
|
|
|
|
- `gRu` fetches remotes updates.
|
|
|
|
- `gRp` prunes all stale remote tracking branches.
|
[git] Review aliases and README.md
This complements the changes done in the last commit, and also fixes the
`glg` output, and removes the now unnecessary `--date=relative`
parameter from `glG`.
Although I insisted on the `--long-option` format on 8669a4f, I think
`rm -rf` is pretty common and recognizable, so revert to that.
Add missing aliases to README.md, and improve description of existing
ones. The main improvement is trying to be more concise, so instead of
repeating "records changes to the repository" multiple times, simply say
"commits", for example. Also try to use words that match the alias
letters, so for "gcs" say "shows" instead of "displays", for example.
2018-01-11 11:30:20 -05:00
|
|
|
- `gRs` shows information about a given remote.
|
2015-12-15 02:28:02 -05:00
|
|
|
|
|
|
|
### Stash
|
|
|
|
|
|
|
|
- `gs` stashes the changes of the dirty working directory.
|
|
|
|
- `gsa` applies the changes recorded in a stash to the working directory.
|
|
|
|
- `gsx` drops a stashed state.
|
|
|
|
- `gsX` drops all the stashed states.
|
|
|
|
- `gsl` lists stashed states.
|
|
|
|
- `gsd` displays changes between the stash and its original parent.
|
|
|
|
- `gsp` removes and applies a single stashed state from the stash list.
|
|
|
|
- `gsr` recovers a given stashed state.
|
[git] Review aliases and README.md
This complements the changes done in the last commit, and also fixes the
`glg` output, and removes the now unnecessary `--date=relative`
parameter from `glG`.
Although I insisted on the `--long-option` format on 8669a4f, I think
`rm -rf` is pretty common and recognizable, so revert to that.
Add missing aliases to README.md, and improve description of existing
ones. The main improvement is trying to be more concise, so instead of
repeating "records changes to the repository" multiple times, simply say
"commits", for example. Also try to use words that match the alias
letters, so for "gcs" say "shows" instead of "displays", for example.
2018-01-11 11:30:20 -05:00
|
|
|
- `gss` stashes the working directory changes, including untracked files.
|
|
|
|
- `gsS` stashes the working directory changes interactively.
|
|
|
|
- `gsw` stashes the working directory changes retaining the index.
|
2016-05-05 06:56:08 -04:00
|
|
|
- `gsu` unapplies (reverts) applied changes.
|
2015-12-15 02:28:02 -05:00
|
|
|
|
|
|
|
### Submodule
|
|
|
|
|
|
|
|
- `gS` initializes, updates, or inspects submodules.
|
|
|
|
- `gSa` adds given a repository as a submodule.
|
|
|
|
- `gSf` evaluates a shell command in each of checked out submodules.
|
|
|
|
- `gSi` initializes submodules.
|
|
|
|
- `gSI` initializes and clones submodules recursively.
|
|
|
|
- `gSl` lists the commits of all submodules.
|
|
|
|
- `gSm` moves a submodule.
|
|
|
|
- `gSs` synchronizes submodules' remote URL to the value specified in
|
|
|
|
.gitmodules.
|
[git] Review aliases and README.md
This complements the changes done in the last commit, and also fixes the
`glg` output, and removes the now unnecessary `--date=relative`
parameter from `glG`.
Although I insisted on the `--long-option` format on 8669a4f, I think
`rm -rf` is pretty common and recognizable, so revert to that.
Add missing aliases to README.md, and improve description of existing
ones. The main improvement is trying to be more concise, so instead of
repeating "records changes to the repository" multiple times, simply say
"commits", for example. Also try to use words that match the alias
letters, so for "gcs" say "shows" instead of "displays", for example.
2018-01-11 11:30:20 -05:00
|
|
|
- `gSu` fetches and merges the latest changes for all submodules.
|
2015-12-15 02:28:02 -05:00
|
|
|
- `gSx` removes a submodule.
|
|
|
|
|
[git] Review aliases and README.md
This complements the changes done in the last commit, and also fixes the
`glg` output, and removes the now unnecessary `--date=relative`
parameter from `glG`.
Although I insisted on the `--long-option` format on 8669a4f, I think
`rm -rf` is pretty common and recognizable, so revert to that.
Add missing aliases to README.md, and improve description of existing
ones. The main improvement is trying to be more concise, so instead of
repeating "records changes to the repository" multiple times, simply say
"commits", for example. Also try to use words that match the alias
letters, so for "gcs" say "shows" instead of "displays", for example.
2018-01-11 11:30:20 -05:00
|
|
|
### Tag
|
|
|
|
|
|
|
|
- `gt` creates, lists, deletes or verifies a tag object signed with GPG.
|
|
|
|
- `gts` creates a GPG-signed tag.
|
|
|
|
- `gtv` verifies the GPG signature of tags.
|
|
|
|
- `gtx` deletes tags with given names.
|
|
|
|
|
|
|
|
### Working tree
|
2015-12-15 02:28:02 -05:00
|
|
|
|
|
|
|
- `gws` displays working-tree status in the short format.
|
|
|
|
- `gwS` displays working-tree status.
|
|
|
|
- `gwd` displays changes between the working tree and the index (diff).
|
|
|
|
- `gwD` displays changes between the working tree and the index (word diff).
|
[git] Review aliases and README.md
This complements the changes done in the last commit, and also fixes the
`glg` output, and removes the now unnecessary `--date=relative`
parameter from `glG`.
Although I insisted on the `--long-option` format on 8669a4f, I think
`rm -rf` is pretty common and recognizable, so revert to that.
Add missing aliases to README.md, and improve description of existing
ones. The main improvement is trying to be more concise, so instead of
repeating "records changes to the repository" multiple times, simply say
"commits", for example. Also try to use words that match the alias
letters, so for "gcs" say "shows" instead of "displays", for example.
2018-01-11 11:30:20 -05:00
|
|
|
- `gwr` resets the current *HEAD* to the specified state, does not touch the
|
|
|
|
index nor the working tree.
|
|
|
|
- `gwR` resets the current *HEAD*, index and working tree to the specified
|
|
|
|
state.
|
|
|
|
- `gwc` cleans untracked files from the working tree (dry-run).
|
|
|
|
- `gwC` cleans untracked files from the working tree.
|
2015-12-15 02:28:02 -05:00
|
|
|
- `gwx` removes files from the working tree and from the index recursively.
|
|
|
|
- `gwX` removes files from the working tree and from the index recursively and
|
|
|
|
forcefully.
|
|
|
|
|
[git] Review aliases and README.md
This complements the changes done in the last commit, and also fixes the
`glg` output, and removes the now unnecessary `--date=relative`
parameter from `glG`.
Although I insisted on the `--long-option` format on 8669a4f, I think
`rm -rf` is pretty common and recognizable, so revert to that.
Add missing aliases to README.md, and improve description of existing
ones. The main improvement is trying to be more concise, so instead of
repeating "records changes to the repository" multiple times, simply say
"commits", for example. Also try to use words that match the alias
letters, so for "gcs" say "shows" instead of "displays", for example.
2018-01-11 11:30:20 -05:00
|
|
|
### Misc
|
|
|
|
|
|
|
|
- `g..` changes the current directory to the top level of the working tree.
|
|
|
|
|
2015-12-15 02:28:02 -05:00
|
|
|
### Shadows
|
|
|
|
|
|
|
|
The following aliases may shadow system commands:
|
|
|
|
|
|
|
|
- `gpt` shadows the GUID partition table maintenance utility.
|
|
|
|
- `gs` shadows Ghostscript.
|
|
|
|
|
|
|
|
If you frequently use the above commands, you may wish to remove said aliases
|
|
|
|
from this module or to disable them at the bottom of the zshrc with `unalias`.
|
|
|
|
|
|
|
|
You can temporarily bypass an alias by prefixing it with a backward slash:
|
|
|
|
`\gpt`.
|
|
|
|
|
|
|
|
Functions
|
|
|
|
---------
|
|
|
|
|
|
|
|
- `git-branch-current` displays the current branch.
|
|
|
|
- `git-dir` displays the path to the Git directory.
|
|
|
|
- `git-ignore-add` adds any arguments to the .gitignore in the project root.
|
|
|
|
- `git-root` displays the path to the working tree root.
|
|
|
|
- `git-stash-clear-interactive` asks for confirmation before clearing the stash.
|
|
|
|
- `git-stash-recover` recovers given dropped stashed states.
|
|
|
|
- `git-submodule-move` moves a submodule.
|
|
|
|
- `git-submodule-remove` removes a submodule.
|