This page is a work in progress, and is not yet complete. Not every project has a Git repository -- just like not every project has an SVN or CVS repository.

−

</div></div>

−

<br>

−

−

== Git mirrors of CVS repositories ==

−

−

The CVS repositories at Eclipse.org are being mirrored to read-only Git repositories. Please see the [http://dev.eclipse.org/git/ git cvs mirror page] for the full list of repositories. Please note that while Git mirrors will eventually be deleted for those projects that migrate to Git, projects may exist in both places. So check the fully hosted [http://git.eclipse.org/ git repositories] first!

−

−

== Git repositories ==

−

−

Eclipse projects may use either CVS, SVN or Git. The project you are looking for may not be using Git. Please see [[CVS Howto]] and [[SVN Howto]] for more information. If you are unsure which type of repository a project is using, please go to that project's home page.

−

=== List of Git repositories available ===

=== List of Git repositories available ===

−

Please connect to http://git.eclipse.org/

+

Please see to http://git.eclipse.org/. NOTE: please use the clone links at the bottom of the pages.. Do not clone from git.eclipse.org/c/

Committer access via https is disabled (and discouraged), but it is available. Please ask Webmaster if you absolutely need commit access over https.

+

Committer access via https is disabled (and discouraged), but it is available. Please ask Webmaster if you absolutely need commit access over https. Before this try if option no.2 (proxy.eclipse.org on port 443) works for you.

[[Image:Git-correct.png|thumb|The right way]] Before committing code to your cloned repo, please ensure that your Git environment is properly set. Otherwise, the email address stored in the commit transaction in your repository will not match the email address of your Eclipse Committer record with the Eclipse Foundation, and your push will fail.

Due to our rigorous IP process, the Eclipse.org use-case for a DVCS is different than that of other Open Source organizations. For this reason, an update hook is installed '''and must remain in place''' on every Git repository to ensure a clean IP provenance.

Due to our rigorous IP process, the Eclipse.org use-case for a DVCS is different than that of other Open Source organizations. For this reason, an update hook is installed '''and must remain in place''' on every Git repository to ensure a clean IP provenance.

−

The Eclipse update hook will examine the '''Committer''' entries of an incoming push. All the committer entries '''must''' be made by the committer performing the push, or the push will fail. Furthermore, your committer ID, or the committer email address registered with your committer account at the Eclipse Foundation must be present in the Committer Email record. Here are some scenarios to help understand this restriction:

+

The Eclipse update hook will examine the '''Committer''' entries of an incoming push. All the committer entries '''must''' be of committers on the project, or the push will fail. Furthermore, your committer ID, or the committer email address registered with your committer account at the Eclipse Foundation must be present in the Committer Email record. Here are some scenarios to help understand this restriction:

'''Scenario 1'''

'''Scenario 1'''

Line 82:

Line 74:

Jane Contributer pushes (publishes) to a committer's local repo.

Jane Contributer pushes (publishes) to a committer's local repo.

Committer pushes code to git.eclipse.org will '''fail'''.

Committer pushes code to git.eclipse.org will '''fail'''.

−

Committer cannot push code to us that they did not Commit.

+

Committer cannot push code to us from a non-committer.

+

'''Scenario 2'''

'''Scenario 2'''

−

Jane Committer is Author of code. Commits to her local repo.

+

Jane Committer, known as jane@bigcorp.com to the Eclipse Foundation,

−

Jane Committer pushes (publishes) to another committer's local repo.

+

is Author of code. Commits to her local repo as jane@someisp.com.

−

Committer pushes code to git.eclipse.org will '''fail'''.

+

−

Committer cannot push code to us that they did not commit (even if it is

+

−

from another committer).

+

−

+

−

'''Scenario 3'''

+

−

Jane Committer, known as jane@bigcorp.com to the Eclipse Foundation, is Author of code. Commits to her local repo as jane@someisp.com.

+

Jane Committer pushes code to git.eclipse.org will '''fail'''.

Jane Committer pushes code to git.eclipse.org will '''fail'''.

Eclipse.org does not recognize jane@someisp.com.

Eclipse.org does not recognize jane@someisp.com.

+

+

+

'''Scenario 3'''

+

Jane Committer, on project B, is Author of code for Project A. Commits to her local repo.

+

Jane Committer pushes (publishes) to a committer A's local repo.

+

Committer A pushes code to git.eclipse.org will '''fail'''.

+

Committer A cannot push code from a committer who is not on their project.

+

'''Scenario 4'''

'''Scenario 4'''

Line 102:

Line 97:

Committer pushes code to git.eclipse.org will '''succeed'''.

Committer pushes code to git.eclipse.org will '''succeed'''.

Committer can push their committed code to us, preserving the Author information in the transaction.

Committer can push their committed code to us, preserving the Author information in the transaction.

+

+

+

'''Scenario 5'''

+

Project Team A has 5 committers. All committers commit to local repo.

+

Committer pushes code to git.eclipse.org will '''succeed'''.

+

Committer can push their committed code, as well as commits performed by other project members.

+

Please see [[Development_Resources/Handling_Git_Contributions | Handling Git Contributions]] for information on how to handle "pull" requests from non-committers.

Please see [[Development_Resources/Handling_Git_Contributions | Handling Git Contributions]] for information on how to handle "pull" requests from non-committers.

Line 112:

Line 114:

For consistency, the name of the repository '''must''' end with .git.

For consistency, the name of the repository '''must''' end with .git.

+

+

To set the description of the repository as shown on http://git.eclipse.org/, use SFTP to copy the desired content to the file <tt>/gitroot/project/org.eclipse.repo.name.git/description</tt>.

=== Permanently deleting code from Git ===

=== Permanently deleting code from Git ===

Line 119:

Line 123:

=== Setting up ssh keys ===

=== Setting up ssh keys ===

−

['''This doesn't work unless you are a project lead or are granted a proper shell to work in (only project leads at the moment). See [https://bugs.eclipse.org/bugs/show_bug.cgi?id=312034 bug 312034].''']

−

To avoid having to type in your password for each interaction with the server when using git from the command line:

+

To avoid having to type in your password for each interaction with the server when using git from the command line, we recommend using public key authentication. The easiest way to generate a key pair, and to upload your public key to git.eclipse.org, is to do so from within Eclipse. Please see this document for more details:

−

*Generate a public/private key pair if you don't already have one on your own machine

['''At the moment, sftp is blocked, and using scp works, but you cannot run the mkdir command so cannot put the *.pub files into authorized_keys.''']

+

Or do it the manual way:

+

+

Generate a public/private key pair if you don't already have one on your own machine

+

ssh user@git.eclipse.org "mkdir .ssh; chmod 700 .ssh"

+

scp ~/.ssh/id_rsa.pub [user@git.eclipse.org:.ssh/authorized_keys

=== Setting up https for pushing<br> ===

=== Setting up https for pushing<br> ===

+

+

+

Please note: Git access via HTTPS is not enabled by default. Projects must explicitly request this feature via a bug.

+

Here is a sample ''.gitconfig'' file which is used for '''git push''' via https. It is expected to be into your user's system directory (e.g. for Windows Vista "''C:\Users\dtenev\.gitconfig''").<br>

Here is a sample ''.gitconfig'' file which is used for '''git push''' via https. It is expected to be into your user's system directory (e.g. for Windows Vista "''C:\Users\dtenev\.gitconfig''").<br>

Line 179:

Line 183:

* [mailto:caniszczyk@gmail.com Chris Aniszczyk]

* [mailto:caniszczyk@gmail.com Chris Aniszczyk]

* [mailto:wayne@eclipse.org Wayne Beaton]

* [mailto:wayne@eclipse.org Wayne Beaton]

+

+

=== You don't need Git to get code from repository ===

+

+

As mentioned in {{bug|329841}} you can use the [http://hjemli.net/git/cgit/about/ cGit web interface] to get code, if you just need the code, and do not need to clone the repository, say to prepare patches or commit changes back in to the main repository.

+

+

* This is useful for things like checking out test scripts, say to a hudson slave, there you just need the files to

+

start a larger test process, such as using Ant's get task to get a URL such as

If you want to add code review to your Git tool box then see [[Gerrit|Gerrit]].

+

+

= Errors in Cloning =

+

+

If your project has requested HTTPS push access, and your are trying to clone(anonymously(via HTTP or GIT)) and receiving 'Corrupted object' warnings:

+

+

* Try to commit a change via ssh(or have another committer on your project do so)

+

* Ask your rel-eng to check the permissions on the object in the repo ( should be at least 444 )

+

+

If the ssh commit works, and the permissions are not ok then either file a bug, or send a note to Webmaster asking to have the default mask on your git repo repaired. See bug [https://bugs.eclipse.org/bugs/show_bug.cgi?id=363599 363599] for details.

+

+

= Resources =

+

+

The following resources are recommended reading for anyone new to Git or patch-based distributed version control systems in general. Feel free to add links here to reading that you found to be useful.

+

+

*[[EGit/User Guide]] - describes the dialogs and commands that can be accessed for the EGit eclipse plugin

+

*[http://progit.org/book/ Pro Git] - a handy description of how git works and some of what git can do

* [http://tom.preston-werner.com/2009/05/19/the-git-parable.html The Git Parable] - A document describing how Git works

+

* [http://hginit.com/00.html Subversion Re-education] - A guide to the conceptual differences between revision based systems like Subversion/CVS and patch-based systems like Git/Mercurial.

+

* [http://www.vogella.de/articles/Git/article.html Git tutorial from Lars Vogel] - Describes the usage of the Git command line

+

* [http://www.vogella.com/articles/EGit/article.html EGit tutorial from Lars Vogel] - Describes the usage of the EGit team provider

+

+

= Recommended Practices=

+

+

* Provide a description for your Git repository by editing the ''description'' file in the repository root. This description is used in a couple of different places to help the community understand the purpose of the repository. Keep the description concise (e.g. one line of prose).

+

* Provide a ''CONTRIBUTING'' file in the root of your Git repository. GitHub, for example, [https://github.com/blog/1184-contributing-guidelines encourages] this convention to help members of the community understand how to contribute to the project.

+

** TODO provide an example of this

+

** Note that an Eclipse project cannot simply accept a Git pull request. Before a pull request can be accepted, the contributor must have agreed to the Eclipse [http://www.eclipse.org/legal/termsofuse.php Terms of Use]. A contributor who has an Eclipse account implicitly makes this sort of agreement.

Committer access via https is disabled (and discouraged), but it is available. Please ask Webmaster if you absolutely need commit access over https. Before this try if option no.2 (proxy.eclipse.org on port 443) works for you.

IP process implications of DVCS

Due to our rigorous IP process, the Eclipse.org use-case for a DVCS is different than that of other Open Source organizations. For this reason, an update hook is installed and must remain in place on every Git repository to ensure a clean IP provenance.

The Eclipse update hook will examine the Committer entries of an incoming push. All the committer entries must be of committers on the project, or the push will fail. Furthermore, your committer ID, or the committer email address registered with your committer account at the Eclipse Foundation must be present in the Committer Email record. Here are some scenarios to help understand this restriction:

Scenario 1
Jane Contributor is Author of code. Commits to her local repo.
Jane Contributer pushes (publishes) to a committer's local repo.
Committer pushes code to git.eclipse.org will fail.
Committer cannot push code to us from a non-committer.

Scenario 2
Jane Committer, known as jane@bigcorp.com to the Eclipse Foundation,
is Author of code. Commits to her local repo as jane@someisp.com.
Jane Committer pushes code to git.eclipse.org will fail.
Eclipse.org does not recognize jane@someisp.com.

Scenario 3
Jane Committer, on project B, is Author of code for Project A. Commits to her local repo.
Jane Committer pushes (publishes) to a committer A's local repo.
Committer A pushes code to git.eclipse.org will fail.
Committer A cannot push code from a committer who is not on their project.

Scenario 4
Joe Contributor Authors code. Commits to his local repo.
Joe Contributor attaches patch to Bugzilla.
Committer applies patch to his local repo, commits to his local repo.
Committer pushes code to git.eclipse.org will succeed.
Committer can push their committed code to us, preserving the Author information in the transaction.

Scenario 5
Project Team A has 5 committers. All committers commit to local repo.
Committer pushes code to git.eclipse.org will succeed.
Committer can push their committed code, as well as commits performed by other project members.

Creating a new repository

Webmaster can create a new repository for you. Just open a bug against Eclipse Foundation > Community > Git. However, Eclipse committers with shell accounts can create new repositories:

initrepo /gitroot/project/org.eclipse.repo.name.git

For consistency, the name of the repository must end with .git.

To set the description of the repository as shown on http://git.eclipse.org/, use SFTP to copy the desired content to the file /gitroot/project/org.eclipse.repo.name.git/description.

Permanently deleting code from Git

If you are required to permanently remove code from a Git repository, please open a bug against Community/Git and Webmaster will do this for you.

Setting up ssh keys

To avoid having to type in your password for each interaction with the server when using git from the command line, we recommend using public key authentication. The easiest way to generate a key pair, and to upload your public key to git.eclipse.org, is to do so from within Eclipse. Please see this document for more details:

Referencing git repositories on the wiki

To include a reference to your Git repository on your wiki page, you can use the Git Link Template. This links to the web interface where readers can get an overview of the repository, browse the source code, and see some commit stats. Here is an example:

You don't need Git to get code from repository

As mentioned in bug 329841 you can use the cGit web interface to get code, if you just need the code, and do not need to clone the repository, say to prepare patches or commit changes back in to the main repository.

This is useful for things like checking out test scripts, say to a hudson slave, there you just need the files to

start a larger test process, such as using Ant's get task to get a URL such as

Recommended Practices

Provide a description for your Git repository by editing the description file in the repository root. This description is used in a couple of different places to help the community understand the purpose of the repository. Keep the description concise (e.g. one line of prose).

Provide a CONTRIBUTING file in the root of your Git repository. GitHub, for example, encourages this convention to help members of the community understand how to contribute to the project.

TODO provide an example of this

Note that an Eclipse project cannot simply accept a Git pull request. Before a pull request can be accepted, the contributor must have agreed to the Eclipse Terms of Use. A contributor who has an Eclipse account implicitly makes this sort of agreement.