git-sync/org-sync
This commit is contained in:
13
dotfiles/lib/shellenv/git-sync.sh
Normal file
13
dotfiles/lib/shellenv/git-sync.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
function git-sync {
|
||||
local target="$1"
|
||||
local destination="$2"
|
||||
cd "$destination"
|
||||
git fetch origin
|
||||
# This won't work for branches other than master
|
||||
git rebase origin/master
|
||||
|
||||
rsync -t $target/* $destination
|
||||
git commit -am "$(date)"
|
||||
git push origin HEAD
|
||||
git clean -fd
|
||||
}
|
Reference in New Issue
Block a user