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:

  • Visual Studio 2013 GitHub
  • KDiff3 under cygwin git will not invoke
  • Git | Branching model for a large project
  • git stash blunder: git stash pop and ended up with merge conflicts
  • Node.js node_modules checked into git with Linux/Unix & Windows developers?
  • JGit RevWalk.parseTag does not release lock on pack file
    • 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?

  • Different databases for specific branches of git project
  • How to remove a branch?
  • Git pushing to remote origin—changes are not commited in origin, only visible after git stash
  • Github shows name instead of a linked username in commits
  • AWS Deployment Failed due to “HEALTH_CONSTRAINTS”
  • Close Jira issue via Git commit
  • 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.