Difference between revisions of "Development/Tutorials/Git/GitQuickStart"

Jump to: navigation, search
(Commit changes)
m (Added link to help generating the SSH key)
 
(3 intermediate revisions by 2 users not shown)
Line 29: Line 29:
 
=== Setting up ssh keys for authentication ===
 
=== Setting up ssh keys for authentication ===
  
* create a set of keys to use using ssh-keygen, and name the key e.g. id_rsa.kde.
+
* create a set of keys to use using ssh-keygen, look [http://techbase.kde.org/Contribute/Get_a_Contributor_Account#Generating_the_SSH_keys here] for help.
 
* log in to https://identity.kde.org/
 
* log in to https://identity.kde.org/
 
* go to "Profile" -> "Edit" -> "Edit public ssh keys"
 
* go to "Profile" -> "Edit" -> "Edit public ssh keys"
Line 36: Line 36:
 
=== Tell ssh to use this key ===
 
=== Tell ssh to use this key ===
  
* put the following in your ~/.ssh/config :
+
* put the following in your ~/.ssh/config (note that id_rsa.kde is your private key, with default name id_rsa):
  
 
   Host git.kde.org
 
   Host git.kde.org
 
     User git
 
     User git
 
     IdentityFile ~/.ssh/id_rsa.kde
 
     IdentityFile ~/.ssh/id_rsa.kde
 
 
  
 
=== Commit changes ===
 
=== Commit changes ===

Latest revision as of 13:51, 17 July 2013

Contents

[edit] Getting the sources from git

  • head over to https://projects.kde.org/projects . There you'll see a long list with all the projects hosted on KDE git.
  • find the project you are interested in, and click the link, e.g. to Attica
  • on the Attica project page, go to the repository page. There you will find the clone command.
  • Execute this clone command and you'll get a copy of the sources:
   $ git clone git://anongit.kde.org/attica

[edit] Pushing your changes

If you followed the steps above, you now have a clone of the git repository.

In order to be able to commit your changes, you need

  • tell git to push to git.kde.org, instead of anongit.kde.org
  • to setup a ssh key for authentication
  • tell ssh to use that key for git.kde.org

In the following we go through this step by step

[edit] Telling git to push to git.kde.org

Above, we got the sources from anongit.kde.org. These are mirrors of git.kde.org and should for performance reasons be used for obtaining the sources. But for committing git.kde.org has to be used.

This is done by putting the following into ~/.gitconfig:

 [url "git@git.kde.org:"]
     pushInsteadOf = git://anongit.kde.org/


[edit] Setting up ssh keys for authentication

  • create a set of keys to use using ssh-keygen, look here for help.
  • log in to https://identity.kde.org/
  • go to "Profile" -> "Edit" -> "Edit public ssh keys"
  • upload the public key you just created

[edit] Tell ssh to use this key

  • put the following in your ~/.ssh/config (note that id_rsa.kde is your private key, with default name id_rsa):
 Host git.kde.org
   User git
   IdentityFile ~/.ssh/id_rsa.kde

[edit] Commit changes

  • set your git identity
  $ git config --global user.email "you@example.com"
  $ git config --global user.name "Your Name"
  • add the changed file(s):
  $ git add <filename(s)>
  • run git commit:
  $ git commit -m "commit message"
  • now you should be able to push your changes to the central git repository:
  $ git push

This page was last modified on 17 July 2013, at 13:51. This page has been accessed 5,382 times. Content is available under Creative Commons License SA 3.0 as well as the GNU Free Documentation License 1.2.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal