Monday, March 29, 2010

git simple upload branch

So I just got involved using git for the USB host shield. Really neat arduino project. Well its hosted on github, and while git seems awesome in its capabilities, it makes it more difficult to get started. I'm suppose to work in the dev branch, and I set up my ssh keys according to the website. And I have read/write priveleges, but it still took me an hour and a half to figure out how to download the branch, make a change and upload to the dev branch. Here is how you do it.


git clone git@github.com:felis/USB_Host_Shield.git
git checkout --track -b dev origin/dev
git commit -a
git push origin dev

So you clone the remote directory to your own, then you checkout the branch and give it a local name, in this case dev. Then you make commits, which are local. Then you push your commits to the server. the origin keyword keeps the url of where you got the branch, or something like that. You can also list the branches and find out which one you're on using git branch -a

No comments: