You can't explain Git in one post because it is so big and there are tons of ways to do the same thing, that is why I like it so much, among others though. If you want a complete guide to learn Git, I would suggest Pro Git which is free and really really complete.
Now, to the point. I just published my first Android Application to the Android Market (more on this later) :) it is not really that big. It is something I built in my free time and to learn Android. It is nice I like it a lot and I am planning more things. Anyways, I had to create a branch to separate the stable version which is published right now, from the dev version since I am still adding more things. Branching in Git is so easy! really I wish Subversion was that easy. Although, I had to create a remote branch since I am using GitHub either way was easier than anything else so these are the steps to accomplish this:
git pull origin master -- to get everything from your repository git branch <name of your branch> -- creating the branch git checkout <name of your branch> -- changing to the new branch -- make all the changes you need git push origin <name of your branch> -- pushing the new branch to your github repository
If you are done with your branch and all your tests have been completed it is time to merge. Merging is also really easy just one command and that is all:
git merge <name of your branch> -- will merge <name of your branch> on top of the current branch you are working on
More useful commands are:
git status -- to check the status and what has changed git branch -- will list all your branches git add . -- will add all the files modified to a commit ready state
There are a lot of commands and a lot of ways to accomplish the same thing so I strongly recommend to read the documentation to get familiar with all the possibilities.
Happy coding :)
No comments:
Post a Comment