From 4c7c4fc4d04a5d711aebb9bd25bf459a28e2eddd Mon Sep 17 00:00:00 2001 From: "https://www.google.com/accounts/o8/id?id=AItOawll4Kgp7nMuOKdB0FfbcYZ3KRq7HCS0Slc" Date: Thu, 16 Jan 2014 17:47:45 +0000 Subject: [PATCH] Added a comment: Rebase all branches --- ..._057f0079fbee3451ccda08026bab21d4._comment | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 doc/forum/migrate_existing_git_repository_to_git-annex/comment_4_057f0079fbee3451ccda08026bab21d4._comment diff --git a/doc/forum/migrate_existing_git_repository_to_git-annex/comment_4_057f0079fbee3451ccda08026bab21d4._comment b/doc/forum/migrate_existing_git_repository_to_git-annex/comment_4_057f0079fbee3451ccda08026bab21d4._comment new file mode 100644 index 0000000000..e8495560ae --- /dev/null +++ b/doc/forum/migrate_existing_git_repository_to_git-annex/comment_4_057f0079fbee3451ccda08026bab21d4._comment @@ -0,0 +1,20 @@ +[[!comment format=sh + username="https://www.google.com/accounts/o8/id?id=AItOawll4Kgp7nMuOKdB0FfbcYZ3KRq7HCS0Slc" + nickname="Laura" + subject="Rebase all branches" + date="2014-01-16T17:47:45Z" + content=""" + +For the portion: git rebase master mybranch # how to automate this for all branches? + +Try this: + +branch_to_ignore='git-annex|master|newroot' +for branch in $(git for-each-ref --sort=-committerdate refs/heads --format='%(refname:short)' | egrep -v $branch_to_ignore ) + do git rebase --onto master \"$branch~\" \"$branch\" + echo \"Rebasing branch $branch onto master....\" +done + +Feel free to add/correct as necessary + +"""]]