Starting out with a new version control system is always a unique experience. Half of your time is spent crossing fingers and hoping that you didn't just cause irreparable damage to your repository and the other half is time spent pouring over manuals and Google results to try and get just the right commands so that the worst case (hopefully) never happens.
For a little bit now, I've been playing with git (due to my pet project, Joind.in being moved and open sourced over on github. It's a different sort of experience than I'm used to coming from a CVS and SVN world where there's one server and everything you do goes through that. Git's different in its distributed nature and it takes a bit of getting used to - some of the core concepts are a bit different since, essentially, your clone is a full copy of the repository (and is a repository all to itself). It's a little strange and I don't think I fully have a handle on it yet, but I'm getting (gitting? yeah, had to throw in a pun somewhere) there.
In the meantime, I came up against something today I hadn't had to deal with on the project. Previously, the Joind.in source was on a SVN server hosted on another machine. I had some other developers working with me on it while I was over there, and most of the changes were pretty easy to integrate with few conflicts. I've gotten used to handling merges in SVN, but since git's "total repo" method is a good bit different than SVN's approach, it took a little doing to figure out how to merge in changes from a forked repository on github and integrate them back into the master. I (finally) got it to cooperate so I wanted to share the steps I took to get it working. I know this isn't the only way to make the merge happen, and probably isn't even a true merge, but it got the job done.
In this example I'm going to be merging changes from Lorna Mitchell's fork of the code back into the main line.
First off, for the impatient folks in the front row, here's the full list of commands:
PLAIN TEXT PHP:- mkdir lorna
- cd lorna
- git init
- git remote add lorna git://github.com/lornajane/joind.in.git
- git remote add joindin git@github.com:enygma/joind.in.git
- git pull joindin master
- git checkout -b lorna/master
- git pull lorna master
- git add path/to/file.php
- git checkout master
- git status
Truncated by Planet PHP, read more at the original (another 3315 bytes)