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 .git folder 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?

  • Magento upgrading with Git
  • html export different branch
  • Deploy existing repo to heroku with Eclipse
  • Count number of lines in a GitHub repository without cloning
  • Can i use git version control application without github?
  • Git Heroku Permission Denied Public Key (after adding public key)
  • Is there a way to get download/clone statistics of a git repository?
  • What is the meaning of the /dist directory in open source projects?
  • 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 .git.

    After Pasting the Project folder in your new laptop, you can checkout/play like normal clone repo.

    $ git checkout <branch-name>
    
    Git Baby is a git and github fan, let's start git clone.