Getting Started/Sources/Amarok Git Tutorial: Difference between revisions

From KDE TechBase
No edit summary
Line 5: Line 5:
[http://tom.preston-werner.com/2009/05/19/the-git-parable.html The Git Parable:] ''Background information that will help you understand git and distributed revision control systems in general''<br> [http://git.or.cz/course/svn.html Git to SVN crash course] ''5 minute introduction to git for experienced SVN users''
[http://tom.preston-werner.com/2009/05/19/the-git-parable.html The Git Parable:] ''Background information that will help you understand git and distributed revision control systems in general''<br> [http://git.or.cz/course/svn.html Git to SVN crash course] ''5 minute introduction to git for experienced SVN users''


== Getting started ==  
== Getting started for people wanting to track Amarok development ==
git clone git://gitorious.org/amarok/amarok.git
This creates an 'amarok' directory. cd into that and use it like normal. And when you want to update:
git pull
will download the new changes.


===gitorious.org===
== Getting started for Developers ==
 
===gitorious.org account setup===


* Create an account on [http://gitorious.org gitorious.org] the git hosting service used by Qt and now Amarok.
* Create an account on [http://gitorious.org gitorious.org] the git hosting service used by Qt and now Amarok.
* On your user page, (that's at http://gitorious.org/~your_nick) click on "Manage SSH keys" and add your SSH key.
* On your user page, (that's at http://gitorious.org/~your_nick) click on "Manage SSH keys" and add your SSH key.
* Again from the user page, click on "Manage aliases" and add any email addresses you've ever used in KDE SVN. This way any commits you've made in the past are tracked back to you. If your gitorious email address is the only one you ever used, then this step isn't needed.
* Again from the user page, click on "Manage aliases" and add any email addresses you've ever used in KDE SVN. This way any commits you've made in the past are tracked back to you. If your gitorious email address is the only one you ever used, then this step isn't needed.
* Request one of the kde-developers admins to add you to the group (the same rules apply as KDE SVN account requests). This will give you push rights to Amarok. Lydia, Ian and Jeff are all admins.
* Request one of the kde-developers admins to add your username to the group (the same rules apply as KDE SVN account requests). This will give you push rights to Amarok. Lydia, Ian and Jeff are all admins.


===Setup Amarok Clone===
===Setup Amarok Clone===
Line 28: Line 34:
  git commit -a #the -a option commits all modified files. use git add to select them individualy
  git commit -a #the -a option commits all modified files. use git add to select them individualy
  git push
  git push
== Getting started for SVN experts  ==
== Getting started for Novices  ==
== Alternatives for users  ==
- gitorious tarballs - svn snapshots
= Rules for using Gitorious  =
#Never, ever create a branch in our mainline repo. Ever. You can do it locally, but do *not* push it up.
#Clone the repo and work on that. Add mainline as a remote branch in your local copy of your cloned repo. This will allow you to easily merge back and forth.
#Pushing branches to your own clone of the mainline repo is fine, however, if you are doing bugfixing or feature branches, use *ONE BRANCH PER FEATURE/BUGFIX*. Gitorious will hopefully improve, but right now it has a downfall in that you can only merge from the start of a branch up to a selected end-point; you can't cherry-pick start and stop points. So if you work on feature A and merge it, then feature B, and want to merge in feature B, you'll have to merge from the start of the branch. So for now at least, just use one branch per feature/bugfix.
For members of the kde-developers group on gitorious only rule 1 is relevant. Outside contributers need to comply with 2 &amp; 3 to be able to do a request pull.

Revision as of 11:32, 20 July 2009

Getting started with git

Recommended reading

The Git Parable: Background information that will help you understand git and distributed revision control systems in general
Git to SVN crash course 5 minute introduction to git for experienced SVN users

Getting started for people wanting to track Amarok development

git clone git://gitorious.org/amarok/amarok.git

This creates an 'amarok' directory. cd into that and use it like normal. And when you want to update:

git pull

will download the new changes.

Getting started for Developers

gitorious.org account setup

  • Create an account on gitorious.org the git hosting service used by Qt and now Amarok.
  • On your user page, (that's at http://gitorious.org/~your_nick) click on "Manage SSH keys" and add your SSH key.
  • Again from the user page, click on "Manage aliases" and add any email addresses you've ever used in KDE SVN. This way any commits you've made in the past are tracked back to you. If your gitorious email address is the only one you ever used, then this step isn't needed.
  • Request one of the kde-developers admins to add your username to the group (the same rules apply as KDE SVN account requests). This will give you push rights to Amarok. Lydia, Ian and Jeff are all admins.

Setup Amarok Clone

Gitorious has one address for cloning, and another for pushing. The pushing address can be used for cloning, so the easy thing to do is just use that.

git clone [email protected]:amarok/amarok.git

This will create a directory 'amarok'. cd into that and start developing!

So what you will do 90% of the time:

git pull #update to latest code
#edit code, build, it works!
git status #to check if you want to commit all the modified files
git commit -a #the -a option commits all modified files. use git add to select them individualy
git push