Move branches without pushing them to the git repository?
I have a git repository and I have created several branches, each one of them has different non-finished work. I don’t want to push them to the main repository unless it’s strictly needed, because, as I said, it is a non-finished work.
Now I got a brand new laptop and I need to save/move that work to the new laptop. My ideas are as follow:
- push the branches to the main repository, which I repeat is the last path I would take if there is not other options
- copy all the
.gitfolder and the current sources to the new laptop
Is there any other way? Would be enough to copy only the
.git folder? Any workaround? How would you achieve this?
One Solution collect form web for “Move branches without pushing them to the git repository?”
Would be enough to copy only the .git folder?
Yes, it’s enough. If you don’t want to push changes to remote then just copy the Project folder with
After Pasting the Project folder in your new laptop, you can checkout/play like normal clone repo.
$ git checkout <branch-name>