-
Notifications
You must be signed in to change notification settings - Fork 1
GitHowTo
This page might be outdated
This will be a quick how to get used to git workflow commands.
First of all, register to github.
Then go to emesene/emesene and click on the “fork” button.
Now you’ve got a yourname/emesene repository.
You’ll see a link named “YOUR Clone Url”.
Copy that link, open a terminal and type:
git clone thatlink emesene
great, now you have a directory called emesene with your project inside.
Now you’re ready to code. Suppose you want to implement the feature “foobar”.
Then type git checkout -b foobar it will create a new branch called “foobar” and switch to it.
Now, just code and, when you think it is right to, commit with: git commit -a (purists will hate me, but this is just a short intro, right?)
In the commit message, follow this simple git convention: first line is long no more than 50 characters, with a short summary. If more explanation is needed you should leave a blank line, then enter your long description on 79-chars limiter lines.
Example:
This is a good commit.
It is good because it implements lot of long-wanted features, like foo and bar
Furthermore, no lolcatz were killed when doing this.
Sometimes your feature is not still complete, but you still want to make the world know about it.
git push origin foobar will upload the branch foobar to your github repository.
You can view it at the url http://github.com/yourname/emesene/tree/foobar
So, you’ll have TWO branches on your github repo: master and foobar.
When you go to github.com/yourname/emesene it will display master by default, but you can browse to “foobar” easily.
When your work on that feature is finally done, you should merge the changes in the master branch.
git checkout master
git merge foobar
If you behave like a good boy, it shouldn’t report conflicts. However, conflicts could happen…
git push origin master will upload the changes you just did to your github master branch.
You could keep your foobar branch (if you like “feature-branch” development style, which I won’t discuss here), or you could delete it:
git push origin :foobar will remove foobar branch from github
git branch -d foobar will remove the branch foobar from your local repo, too.
You heard on the ML that mariano is doing something really great on his repository, and you absolutely want
to put your hands on it.
git remote add mariano git://github.com/marianoguerra/emesene.git (it’s just an alias)
Now, make sure you don’t have uncommited changes! (git status is your friend)
git pull mariano will merge mariano’s repo into yours. If there are conflicts, solve it or git reset --hard