spr icon indicating copy to clipboard operation
spr copied to clipboard

Workflow for syncing to another machine?

Open dhalperi opened this issue 2 years ago • 1 comments

I did something like this:

git checkout -b feature-1
# make commit 1
# make commit 2
git spr update  # created two PRs

Then I switched to another machine. I was able to figure out that I could

git fetch --all
git branch -a
git show remotes/origin/pr/dhalperi/feature-1/<commit>

to figure out which was the top of the stack, then

git checkout remotes/... -b feature-1

followed by git spr status to confirm it worked.

Is that the intended workflow?

Was I supposed to also git push --force feature-1? Somehow, pushing feature-1 myself seems anathema given that git spr is managing all the remote state?

dhalperi avatar Apr 07 '22 02:04 dhalperi

This isn't intended and is untested, but I think it should work ok as long as you rename the branch you fetched as you did. git spr doesn't store any state, so theoretically you should be able to pickup your work on a new machine this way. I don't think you need to force push, calling spr update on the new machine should just work?

ejoffe avatar May 18 '22 09:05 ejoffe

you can now use 'git spr sync' for this. Thank you @adambenhassen for adding this feature.

ejoffe avatar Mar 06 '23 21:03 ejoffe