summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--make/git.mk6
1 files changed, 4 insertions, 2 deletions
diff --git a/make/git.mk b/make/git.mk
index f8436f8..068e7f3 100644
--- a/make/git.mk
+++ b/make/git.mk
@@ -11,8 +11,10 @@ currentbranch = $(shell git branch | grep ^\* | awk '{ print $2 }')
noncurrentbranches = $(filter-out $(currentbranch),$(branches))
update:
- $(if $(filter $(currentbranch),$(master)),,git checkout "$(master)")
- git pull
+ git fetch $(origin)
+ $(if $(filter $(currentbranch),$(master)),,git branch -f "$(master)" "$(origin)/$(master)" && git checkout "$(master)")
+ git merge --no-commit "$(origin)"
+ $(if $(noncurrentbranches),$(foreach branch,$(noncurrentbranches),git branch -f "$(branch)" "$(origin)/$(branch)" && git checkout "$(branch)" && git merge --no-commit "$(origin)" &&) git checkout "$(master)")
init:
# Assume that initial cloning is done already when invoking this target