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

From KDE TechBase
Line 3: Line 3:
== Recommended reading  ==
== Recommended reading  ==


[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 for people wanting to track Amarok development  ==


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


== Getting started for Developers ==  
will download the new changes.
 
== Getting started for Developers ==


===gitorious.org account setup===
=== 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.
* 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===
People with KDE-SVN accounts als should do the following:
 
*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.
 
=== Sending Patches ===
 
*Make sure you have created your account on Gitorious and are logged in. Go to the project you want to clone (e.g. Amarok - http://gitorious.org/amarok) and select the branch which you want to clone (in this case Amarok - Mainline which is the master branch).
*After selecting the branch you can click "Clone this repository on Gitorious". Give your branch a name and you'll be taken to the page of your newly created clone. On this page you find two git urls: one to publicly clone the repository and the "Push url: [email protected]:~yourname/amarok/yourname-clone.git.
*Clone the push url to start working on your clone:<br>git clone 
[email protected]:~yourname/amarok/yourname-clone.git
...work on this checkout - follow the normal development workflow...
push your changes to gitorious
*Create a merge request on gitorious by going to your clone page and selecting "Request merge" in the menu on the right.
 
<br>
 
=== 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.  
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.  
Line 26: Line 45:
  git clone [email protected]:amarok/amarok.git
  git clone [email protected]:amarok/amarok.git


This will create a directory 'amarok'. cd into that and start developing!
This will create a directory 'amarok'. cd into that and start developing!  
 
=== Basic Development ===
 
90% of the time this is all that is needed:


===Basic Development===
90% of the time this is all that is needed:
  git pull #update to latest code
  git pull #update to latest code
  #edit code, build, it works!
  #edit code, build, it works!

Revision as of 12:09, 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

People with KDE-SVN accounts als should do the following:

  • 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.

Sending Patches

  • Make sure you have created your account on Gitorious and are logged in. Go to the project you want to clone (e.g. Amarok - http://gitorious.org/amarok) and select the branch which you want to clone (in this case Amarok - Mainline which is the master branch).
  • After selecting the branch you can click "Clone this repository on Gitorious". Give your branch a name and you'll be taken to the page of your newly created clone. On this page you find two git urls: one to publicly clone the repository and the "Push url: [email protected]:~yourname/amarok/yourname-clone.git.
  • Clone the push url to start working on your clone:
    git clone
[email protected]:~yourname/amarok/yourname-clone.git
...work on this checkout - follow the normal development workflow...
push your changes to gitorious
  • Create a merge request on gitorious by going to your clone page and selecting "Request merge" in the menu on the right.


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!

Basic Development

90% of the time this is all that is needed:

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 individually
git push