Little git extras.
Clone / Tarball:
$ make installOne-liner:
$ (cd /tmp && git clone --depth 1 https://github.com/visionmedia/git-extras.git && cd git-extras && sudo make install)$ sudo port install git-extrasBrew (buggy):
$ brew install git-extrasJust getting started? Check out these screencasts:
- introduction -- covering git-ignore, git-setup, git-changelog, git-release, git-effort and more
git extrasgit squashgit summarygit effortgit changeloggit commits-sincegit countgit create-branchgit delete-branchgit delete-submodulegit delete-taggit fresh-branchgit graftgit aliasgit ignoregit infogit releasegit contribgit replgit undogit gh-pagesgit setupgit touchgit obliterategit featuregit refactorgit buggit promotegit local-commitsgit archive-file
The main git-extras command.
Output the current --version:
$ git extrasList available commands:
$ git extras --helpUpdate to the latest git-extras:
$ git extras updateSets up the gh-pages branch. (See GitHub Pages documentation.)
Create the given feature, refactor, or bug branch name:
$ git feature dependenciesAfterwards, the same command will check it out:
$ git checkout master
$ git feature dependenciesWhen finished, we can feature finish to merge it into the current branch:
$ git checkout master
$ git feature finish dependenciesAll of this works with feature, bug, or refactor.
Output author's contributions to a project:
$ git contrib visionmedia
visionmedia (18):
Export STATUS_CODES
Replaced several Array.prototype.slice.call() calls with Array.prototype.unshift.call()
Moved help msg to node-repl
Added multiple arg support for sys.puts(), print(), etc.
Fix stack output on socket error
...Outputs a repo summary:
$ git summary
project : git-extras
repo age : 10 months ago
commits : 163
active : 60 days
files : 93
authors :
97 Tj Holowaychuk 59.5%
37 Jonhnny Weslley 22.7%
8 Kenneth Reitz 4.9%
5 Aggelos Orfanakos 3.1%
3 Jonathan "Duke" Leto 1.8%
2 Gert Van Gool 1.2%
2 Domenico Rotiroti 1.2%
2 Devin Withers 1.2%
2 TJ Holowaychuk 1.2%
1 Nick Campbell 0.6%
1 Alex McHale 0.6%
1 Jason Young 0.6%
1 Jens K. Mueller 0.6%
1 Guillermo Rauch 0.6%This command can also take a commitish, and will print a summary for commits in the commmitish range:
$ git summary v42..Displays "effort" statistics, currently just the number of commits per file, showing highlighting where the most activity is. The "active days" column is the total number of days which contributed modifications to this file.
node (master): git effort --above 15 {src,lib}/*
If you wish to ignore files with commits <= a value you may use --above:
$ git effort --above 5
By default git ls-files is used, however you may pass one or more files to git-effort(1), for example:
$ git effort bin/* lib/*
GIT read-eval-print-loop:
$ git repl
git> ls-files
History.md
Makefile
Readme.md
bin/git-changelog
bin/git-count
bin/git-delete-branch
bin/git-delete-tag
bin/git-ignore
bin/git-release
git> quitList commits since date (defaults to "last week"):
$ git commits-since
... changes since last week
TJ Holowaychuk - Fixed readme
TJ Holowaychuk - Added git-repl
TJ Holowaychuk - Added git-delete-tag
TJ Holowaychuk - Added git-delete-branch
$ git commits-since yesterday
... changes since yesterday
TJ Holowaychuk - Fixed readmeOutput commit count:
$ git count
total 1844Output detailed commit count:
$ git count --all
visionmedia (1285)
Tj Holowaychuk (430)
Aaron Heckmann (48)
csausdev (34)
ciaranj (26)
Guillermo Rauch (6)
Brian McKinney (2)
Nick Poulden (2)
Benny Wong (2)
Justin Lilly (1)
isaacs (1)
Adam Sanderson (1)
Viktor Kelemen (1)
Gregory Ritter (1)
Greg Ritter (1)
ewoudj (1)
James Herdman (1)
Matt Colyer (1)
total 1844Release commit with the given <tag>:
$ git release 0.1.0Does the following:
- Executes .git/hooks/pre-release.sh (if present)
- Commits changes (to changelog etc) with message "Release <tag>"
- Tags with the given <tag>
- Push the branch / tags
- Executes .git/hooks/post-release.sh (if present)
Define, search and show aliases.
Define a new alias:
$ git alias last "cat-file commit HEAD"Search for aliases that match a pattern (one argument):
$ git alias ^la
last = cat-file commit HEADShow all aliases (no arguments):
$ git alias
s = status
amend = commit --amend
rank = shortlog -sn --no-merges
whatis = show -s --pretty='tformat:%h (%s, %ad)' --date=short
whois = !sh -c 'git log -i -1 --pretty="format:%an <%ae>Too lazy to open up .gitignore? Me too!
$ git ignore build "*.o" "*.log"
... added 'build'
... added '*.o'
... added '*.log'Add patterns from an existing template:
$ git ignore -t railsWithout any patterns, git-ignore displays currently ignored patterns:
$ git ignore
build
*.o
*.logShow information about the repo:
$ git info
## Remote URLs:
origin git@github.com:sampleAuthor/git-extras.git (fetch)
origin git@github.com:sampleAuthor/git-extras.git (push)
## Remote Branches:
origin/HEAD -> origin/master
origin/myBranch
## Local Branches:
myBranch
* master
## Most Recent Commit:
commit e3952df2c172c6f3eb533d8d0b1a6c77250769a7
Author: Sample Author <sampleAuthor@gmail.com>
Added git-info command.
Type 'git log' for more commits, or 'git show <commit id>' for full commit details.
## Configuration (.git/config):
color.diff=auto
color.status=auto
color.branch=auto
user.name=Sample Author
user.email=sampleAuthor@gmail.com
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.url=git@github.com:mub/git-extras.git
branch.master.remote=origin
branch.master.merge=refs/heads/master
If you wish to omit the config section, you may use --no-config:
$ git info --no-configCreate local and remote branch name:
$ git create-branch developmentDelete local and remote branch name:
$ git delete-branch integrationDelete submodule name:
$ git delete-submodule lib/fooDelete local and remote tag name:
$ git delete-tag 0.0.1Create empty local branch name:
$ git fresh-branch docsMerge commits from src-branch into dest-branch. (dest-branch defaults to master.)
$ git graft new_feature dev
$ git graft new_featureMerge commits from src-branch into the current branch as a single commit. When [msg] is given git-commit(1) will be invoked with that message. This is useful when small individual commits within a topic branch are irrelevant and you want to consider the topic as a single change.
$ git squash fixed-cursor-styling
$ git squash fixed-cursor-styling "Fixed cursor styling"Populate a file whose name matches change|history -i_ with commits
since the previous tag. (If there are no tags, populates commits since the project began.)
Opens the changelog in $EDITOR when set.
$ git changelog --tag 1.5.2 && cat History.md
1.5.2 / 2010-08-05
==================
* Docs for git-ignore. Closes #3
* Merge branch 'ignore'
* Added git-ignore
* Fixed <tag> in docs
* Install docs
* Merge branch 'release'
* Added git-release
* Passing args to git shortlog
* Added --all support to git-count
* Initial commitList commits:
$ git changelog --list
* Docs for git-ignore. Closes #3
* Merge branch 'ignore'
* Added git-ignore
* Fixed <tag> in docs
* Install docs
* Merge branch 'release'
* Added git-release
* Passing args to git shortlog
* Added --all support to git-count
* Initial commitRemove the latest commit:
git undoRemove the latest 3 commits:
git undo 3Set up a git repository (if one doesn't exist), add all files, and make an initial commit. dir defaults to the current working directory.
Call touch on the given file, and add it to the current index. One-step creation of new files.
Completely remove a file from the repository, including past commits and tags.
git obliterate secrets.jsonList all commits on the local branch that have not yet been sent to origin. Any additional arguments will be passed directly to git log.
Creates an zip archive of the current git repository. The name of the archive will depend on the current HEAD of your git respository.
