- I'm using Git at work now and would like to increase my experience with it as much as possible.
- I want to have (at least) two, decentralized repositories that I can merge at will. I want one on my laptop and the other on my desktop.
$ mkdir src
$ cd src
$ git init
To import your existing code, simply copy it to your new directory (or run
git initin your existing code directory) and then:
$ git add .
$ git commit -a
All too easy. Now, the slightly trickier part is doing merging code between your various repositories. If you have sshd running on your hosts, you can do the merge over ssh. Here's what I did:
laptop$ git remote add desktop ssh://desktop.host/home/damonkohler/src
laptop$ git branch -a
git remote addcommand will add a new branch for each branch in the desktop repository. The branches will be named "desktop/master," etc. and can then be merged into the laptop repository like so:
laptop$ git merge desktop/master