Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: Mirroring repository state, with branches and submodules.

From: Miklos Vajna <hidden>
Date: 2016-06-15 22:46:24

On Tue, Mar 17, 2009 at 03:21:40PM +0000, Toby White [off-list ref] wrote:
git fetch
for BRANCH in $(git branch -r | cut -d / -f 2); do
   git checkout $BRANCH
   git reset --hard origin/$BRANCH
done
git submodule update --init
First, I think you don't handle the case when you have multiple
remotes. I don't know if this is a problem for you or not.

Second, use plumbing in scripts, git for-each-ref has a stable output
format, while git branch may change.

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help