Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bin/git-comma
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ added=()

# add unknown files...
for arg; do
if [[ -f $arg && -n $(git ls-files -o $arg) ]]; then
git add $arg
if [[ -f "$arg" && -n $(git ls-files -o "$arg") ]]; then
git add "$arg"
added+=($arg)
fi
done

# ...reset them when commit is aborted
git commit ${@:+-o} "$@" || git reset -q -- $added
git commit ${@:+-o} "$@" || git reset -q -- "$added"
2 changes: 1 addition & 1 deletion bin/git-ignored
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#
# Show what files are being ignored in the repo

git ls-files --others --i --exclude-standard
exec git ls-files --others --i --exclude-standard
1 change: 1 addition & 0 deletions bin/git-nuke-untracked-files
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
set -o pipefail

git status -su | cut -d' ' -f2- | tr '\n' '\0' | xargs -0 rm
exit $?
6 changes: 3 additions & 3 deletions bin/git-purge-from-history
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ set -o errexit
#

if [[ $# -eq 0 ]]; then
echo "You must specify a file/directory to purge from your git history"
echo 'You must specify a file/directory to purge from your git history'
exit 1
fi

# make sure we're at the root of git repo
if [[ ! -d .git ]]; then
echo "Error: must run this script from the root of a git repository"
echo 'Error: must run this script from the root of a git repository'
exit 1
fi

Expand All @@ -26,4 +26,4 @@ files=$@
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch $files" HEAD

# remove the temporary history git-filter-branch otherwise leaves behind for a long time
rm -rf .git/refs/original/ && git reflog expire --all && git gc --aggressive --prune
rm -rf .git/refs/original/ && git reflog expire --all && git gc --aggressive --prune
2 changes: 1 addition & 1 deletion bin/git-root-directory
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#
# Print the root of the git checkout you're in.

git rev-parse --show-toplevel
exec git rev-parse --show-toplevel
6 changes: 3 additions & 3 deletions bin/git-submodule-rm
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ if [[ -e $(pwd)/.gitmodules ]]; then
echo 'Usage: git submodule-rm <path ...>'
else
for submodulepath in $@; do
git config -f .git/config --remove-section submodule.$submodulepath
git config -f .gitmodules --remove-section submodule.$submodulepath
git rm --cached $submodulepath
git config -f .git/config --remove-section "submodule.$submodulepath"
git config -f .gitmodules --remove-section "submodule.$submodulepath"
git rm --cached "$submodulepath"
done
fi
else
Expand Down
1 change: 1 addition & 0 deletions bin/git-upstream-sync
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# https://github.com/unixorn/git-extra-commands/blob/master/LICENSE
#
# Sync to upstream/yourforkname and rebase into your local fork. then push
# back into yourfork/yourforkname
#
# Assumes that your upstream fork's remote is named upstream

Expand Down