Skip to content

nodef/extra-git

Repository files navigation

Common utility commands for Git repositories.
📦 NPM, 🖥️ Shell, 📜 Files, 📘 Wiki.

This is an extension of "git-extras" and "git-extra-commands", including some additional commonly used git tools; cpush, apush, and xclone.
You can install this with npm install -g extra-git.sh.

Stability: Experimental.


# Commit current changes and push (inc. submodules)
$ egit cpush "message"

# Amend current changes and push (inc. submodules)
$ egit apush

# Clone repository to local (inc. submodules)
$ egit xclone openstack/openstack




# Do a hard reset and delete all untracked files
$ egit clear


# List authors
$ egit authors --list
$ egit authors --list --no-email

# TJ Holowaychuk <tj@vision-media.ca>
# hemanth.hm <hemanth.hm@gmail.com>
# Jonhnny Weslley <jw@jonhnnyweslley.net>
# nickl- <github@jigsoft.co.za>
# Leila Muhtasib <muhtasib@gmail.com>


# Merge commits from src-branch into the current branch as a single commit
$ egit squash fixed-cursor-styling
$ egit squash fixed-cursor-styling "Fixed cursor styling"
$ egit squash 95b7c52
$ egit squash HEAD~3
$ egit squash HEAD~3 "Work on a feature"




# Current branch name in automation-friendly format
$ egit branch-name
# main

# Delete all local branches that have been merged into HEAD
$ egit delete-local-merged

# Show files being ignored by git in the repo
$ egit ignored


Index

Command Action
abort Abort current git operation.
add-submodule Add submodule to repository.
add-username-remote Adds a remote for the current repository for the given GitHu ...
age A git-blame viewer, written using PyGTK.
ahead-of-master Show commits that haven't made it to master yet.
alias Define, search and show aliases.
amend-push Amend current changes and push (inc. submodules).
amend-push-submodules Amend current changes and push all submodules.
apush Amend current changes and push (inc. submodules).
apush-submodules Amend current changes and push all submodules.
archive-file Export the current HEAD of the git repository to an archive.
attic Displays a list of deleted files in your repository. The out ...
authors Generate authors report.
authors Generate authors report.
basename Get name of repository from URL.
big-file Show files in the repository larger than a threshold size.
branch-name Prints the current branch name in automation-friendly format.
branch-rebaser Kicks off an interactive rebase of all the commits on your b ...
branches-that-touch Shows which branches touch files under a path that are remot ...
browse View the web page for the current repository.
brv List branches sorted by their last commit date.
bulk Run git commands on multiple repositories.
change-author Change one author/email in the history to another.
change-log Transform git log output into a complete Changelog for proje ...
changelog Generate a changelog report.
changes Symlink to git-authors. List authors in the repository in de ...
checkout-by-date Lets you checkout several files at once at the version speci ...
checkout-commit Uses fzf(https//github.com/junegunn/fzf) to checkout a commi ...
checkout-default-branch Checks out the default branch of the origin remote so you do ...
checkout-pr Check out a PR locally.
checkout-preview Uses fzf(https//github.com/junegunn/fzf) to checkout a branc ...
children-of Shows the children of a given git commit.
churn Show which files are getting changed most often in the repos ...
clear Rigorously clean up a repository.
clear-soft Soft clean up a repository.
clone-init-submodules Clone repository to local (inc. submodules).
clone-subset Uses git clone and git filter-branch to remove from the clon ...
coauthor Add a co-author to the last commit.
comma Adds and commits a file in one command.
commit-browser Uses fzf(https//github.com/junegunn/fzf) to browse commit hi ...
commit-push Commit current changes and push (inc. submodules).
commit-push-submodules Commit current changes and push all submodules.
commits-since Show commit logs since some date.
conflicts Show files with conflicts.
contrib Show user's contributions.
copy-branch-name Copy the current branch's name to the clipboard (macOS Only).
count Show commit count.
cp Copy a file keeping its history.
cpush Commit current changes and push (inc. submodules).
cpush-submodules Commit current changes and push all submodules.
create-branch Create branches.
credit Quicker way to assign credit to another author on the latest ...
current-branch Prints the name of the current branch with no odd characters ...
cut-branch Create a new branch pointed at HEAD and reset the curren ...
default-branch Get default branch (local) of repository.
delete-branch Delete branches.
delete-dangling-commits Clean up dangling commits that are not on any branch.
delete-local-merged Delete all local branches that have been merged into HEAD.
delete-merged-branches Delete merged branches.
delete-merged-branches Delete merged branches.
delete-squashed-and-merged-branches Purges all branches that have been squashed and merged to a ...
delete-squashed-branches Delete branches that were squashed.
delete-submodule Delete submodules.
delete-tag Delete tags.
delete-tag Delete tags.
delta Lists changed files.
diff-last Show the last change made to a file in the repository.
divergence Shows differences between local branch and its tracking branch.
edit-conflicts Edit the files that are marked as conflicted during a merge/ ...
effort Show effort statistics on file(s).
feature Create/Merge feature branch.
fetch-prs Get all Pull Request branches as local remote branches by re ...
fetch-pull-requests Fetch pull requests from GitHub so you can git checkout pull ...
files List the files different between the current branch and REVI ...
find-dirty .
flush Compact your repository by dropping all reflogs, stashes, an ...
force-clone overwrite local repositories with clone.
force-mtimes Sets modification times of all files in the repository their ...
forest Prints a text-based tree visualisation of your repository. R ...
fork Fork a repo on github.
fresh-branch Create fresh branches.
fullurl Get full URL of repository from partial.
functionlog Allows you to get a git log of a particular function, not a ...
fzf-add Use fzf(https//github.com/junegunn/fzf) to select files to a ...
fzf-log-browser Use fzf(https//github.com/junegunn/fzf) to browse the reposi ...
fzf-pickaxe-browser Use fzf(https//github.com/junegunn/fzf) to display a git log ...
fzf-reflog-browser Use fzf(https//github.com/junegunn/fzf) to browse the reposi ...
gh-pages Create the GitHub Pages branch.
git Typing git git foo will make git do a git foo instead of com ...
github-open .
gitlab-mr Open a merge request on GitLab.
graft Merge and destroy a given branch.
guilt calculate change between two revisions.
help Print usage details of a command.
history-graph Pretty git log, single line per commit, with branch graphing.
ignore Add .gitignore patterns.
ignore-io Get sample gitignore file.
ignored Show files being ignored by git in the repository.
improved-merge Sophisticated git merge with integrated CI check and automat ...
incoming Show commits in the tracking branch that are not in the loca ...
info Returns information on current repository.
init-submodules Initialize all submodules.
lines Gives you a list of author names with the number of lines la ...
local-commits List local commits.
lock Lock a file excluded from version control.
locked ls files that have been locked.
ls-branch-files List files changed between a specifed branch and the current ...
ls-object-refs Find references to an object with SHA1 in refs, commits, and ...
magic Automate add/commit/push routines.
maildiff A simple git command to email diff in color to reviewer/ co- ...
maxpack Compress a repository's pack files as much as possible.
merge-into Merge one branch into another.
merge-repo Merge two repo histories.
missing Show commits missing from another branch.
move-commits git move-commits num-commits correct-branch moves the last n ...
mr Checks out a merge request locally.
name Get name of repository from URL.
neck Show commits from the HEAD until the first branching point. ...
nuke Nukes a branch locally and on the origin remote.
object-deflate Deflate an loose object file and write to standard output.
obliterate rewrite past commits to remove some files.
oldest-common-ancestor Finds the oldest common ancestor commit between two branches.
origin-head Prints the name of the origin remote's default branch. Not e ...
outgoing Show commits that are on the local branch that have not been ...
overwritten Aggregates git blame information about original owners of li ...
paste Send patches to pastebin for chat conversations.
pie-ify git pie-ify pattern replacement.
plotrepo Uses dot to draw a graph of the repository.
pr Checks out a pull request locally.
promote Promotes a local topic branch to a remote tracking branch of ...
prune-branches Deletes each fully merged branch after prompting for confirm ...
pruneall Prune branches from specified remotes, or all remotes when n ...
psykorebase Rebase a branch with a merge commit.
publish git publish remote remote-branch.
pull-request Create pull request for GitHub project.
purge-from-history Permanently delete files or folders from your git repository.
pylint Runs pylint on any .py files modified or added in the git st ...
rank-contributors Rummages through the changelog and orders contributors by th ...
reauthor Rewrite history to change author's identity.
rebase-authors Adds authorship info to interactive git rebase output.
rebase-patch Rebases a patch.
rebase-theirs Resolve rebase conflicts by favoring 'theirs' version.
recent Shows information about most recent commit on all local bran ...
recently-checkedout-branches Shows timestamp and name of recently checked-out branches in ...
ref-recent Shows the date, branch name, commit hash, and commit subject ...
rel Shows the relationship between the current branch and ref. ...
related Show other files that often get changed in commits that touc ...
release Commit, tag and push changes to the repository.
remote-default-branch Shows the default branch for a specified remote, defaults to ...
rename-branch rename local branch and push to remote.
rename-branches Rename multiple branches that start with a given name.
rename-remote Rename a remote.
rename-tag Rename a tag.
repl git read-eval-print-loop.
reset-file Reset one file.
reset-with-fire Hard reset the working directory, then zap any files not kno ...
restore-mtime Change mtime of files based on commit date of last change.
reup Like git pull but show a short and sexy log of changes after ...
rm-deleted-from-repo Removes files you deleted with rm from the repository for you.
root show path of root.
root-directory Prints the path to the root of the git repository you're in.
roots Show the root commits.
run-command-on-revisions Runs a given command over a range of git revisions.
scp Copy files to SSH compatible git-remote.
sed replace patterns in git-controlled files.
setup Set up a git repository.
shamend Amends your staged changes as a fixup (keeping the pre-exist ...
show-merged-branches Show merged branches.
show-overwritten Aggregates git blame information about the original owners o ...
show-tree show branch tree of commit history.
show-unmerged-branches Show unmerged branches.
shrink-repo Shrinks your clone of a git repository.
sp Simple push, single short command to commit, and push. Use - ...
squash squash N last changes up to a ref'ed commit.
sr Use fzf to switch to a different git ref.
stamp Stamp the last commit message.
standup Recall the commit history.
stats Displays stats for the files different between the current b ...
submodule-rm Allows you to remove a submodule easily with git submodule-r ...
summary Show repository summary.
switch-branch Make it easier to switch to a branch by a substring of its n ...
sync Sync local branch with remote branch.
tag-and-sign Create and sign a new tag.
tag-diff Show the differences between local tags and ones on the remo ...
thanks List the contributors to a repository in descending commit o ...
touch Touch and add file to the index.
track Sets up your branch to track a remote branch. Assumes you me ...
trail Show all branching points in the repository's git history so ...
undelete Undeletes a file.
undo Remove latest commits.
undo Remove latest commits.
undo-push Undoes your last push to branch 1 of origin.
unlock Unlock a file excluded from version control.
unpushed Show which commits have not been pushed to the tracking bran ...
unreleased Shows git commits since the last tagged version.
up Like git pull but show a short and sexy log of changes after ...
upstream-sync Fetches upstream/yourforkname and rebases it into your loc ...
url Get full URL of repository from partial.
utimes Change files modification time to their last commit date.
what-the-hell-just-happened Show what just happened.
when-merged Find when a commit was merged into one or more branches.
where Shows where a particular commit falls between releases.
whoami Shows what username email you have configured for the repos ...
winner Shows what authors have made the most commits, both by numbe ...
wordiness Shows how wordy people's commit messages are. Useful for sha ...
work-in-progress Starts an interactive rebase of all the commits you haven't ...
wtf git-wtf displays the state of your repository in a readable, ...
xclone Clone repository to local (inc. submodules).


References