summaryrefslogtreecommitdiff
path: root/make/git.mk
blob: 072617ecb66be57ab8df17549b6753e4a2131559 (plain)
  1. # main local branch (the one we want checked out)
  2. master = master
  3. # all local branches (including those needed by child clones)
  4. branches = $(master)
  5. # local name of origin
  6. origin = origin
  7. currentbranch = $(shell git branch | grep ^\* | awk '{ print $2 }')
  8. noncurrentbranches = $(filter-out $(currentbranch),$(branches))
  9. update:
  10. git fetch $(origin)
  11. $(if $(filter $(currentbranch),$(master)),,git branch -f "$(master)" "$(origin)/$(master)" && git checkout "$(master)")
  12. git pull "$(origin)"
  13. $(if $(noncurrentbranches),$(foreach branch,$(noncurrentbranches),git branch -f "$(branch)" "$(origin)/$(branch)" && git checkout "$(branch)" && git pull "$(origin)" &&) git checkout "$(master)")
  14. init:
  15. git init
  16. git remote add -f -m "$(master)" origin "$(origin)"
  17. git merge origin
  18. # git config remote.origin.push +"refs/heads/$(master)":"refs/heads/$(master)"
  19. .PHONY: update init
class='graph'>
-rw-r--r--tags/9d/dc/53F63FD7.4060205@guardianproject.info/inbox0
-rw-r--r--tags/9d/dc/53F63FD7.4060205@guardianproject.info/old0
-rw-r--r--tags/9d/dc/A3F34FDA-8563-4E4A-ACB0-FBD4F8B9C94B@gmail.com/sugar0
-rw-r--r--tags/9d/dc/A3F34FDA-8563-4E4A-ACB0-FBD4F8B9C94B@gmail.com/unread0
-rw-r--r--tags/9d/dc/CADf7C8s_8rd4V1oixQ0NnVQhJmVg7fudTebGYpPjhnvKpWuK7Q@mail.gmail.com/sugar0
-rw-r--r--tags/9d/dc/CADf7C8s_8rd4V1oixQ0NnVQhJmVg7fudTebGYpPjhnvKpWuK7Q@mail.gmail.com/unread0
-rw-r--r--tags/9d/dc/E1mJbeS-0005IE-PF@usper.debian.org/debian0
-rw-r--r--tags/9d/dc/E1mJbeS-0005IE-PF@usper.debian.org/inbox0
-rw-r--r--tags/9d/dc/E1mJbeS-0005IE-PF@usper.debian.org/killed0
-rw-r--r--tags/9d/dc/E1mJbeS-0005IE-PF@usper.debian.org/unread0
19 files changed, 0 insertions, 0 deletions