Skip to content

Commit

Permalink
git-mv-remote: rename a remote regardless of any existing remotes
Browse files Browse the repository at this point in the history
  • Loading branch information
timfeirg committed May 8, 2019
1 parent a214c93 commit a4da618
Show file tree
Hide file tree
Showing 7 changed files with 240 additions and 522 deletions.
20 changes: 20 additions & 0 deletions bin/git-rename-remote
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

set -euo pipefail

old=$1
new=$2

test -z $old && echo "old remote name required." 1>&2 && exit 1
test -z $new && echo "new remote name required." 1>&2 && exit 1

if ! git config --get "remote.$old.fetch" > /dev/null; then
echo "remote $old doesn't exist"
exit 1
fi

if git config --get "remote.$new.fetch" > /dev/null; then
git remote remove $new
fi
git remote rename $old $new
git remote -v
236 changes: 0 additions & 236 deletions man/git-extras.1

This file was deleted.

Loading

0 comments on commit a4da618

Please sign in to comment.