Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Git"

m
(42 intermediate revisions by 17 users not shown)
Line 1: Line 1:
<div style="border: thin solid black; background-color: rgb(244, 255, 244); margin: 3px;"><div style="margin: 4px;">
 
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 http://git.eclipse.org/.
 
+
=== My Eclipse project wants to use Git  ===
+
 
+
*New projects may choose Git as their repository in the [http://www.eclipse.org/projects/project_provisioning_request.php New Project Provisioning Request].
+
*Existing projects may migrate to Git from SVN or CVS. Please see [[Git/Migrating to Git]] for more details.
+
 
+
=== Migrating from CVS/SVN to Git  ===
+
 
+
Please see [[Git/Migrating to Git]].  
+
  
 
=== Committers new to Git  ===
 
=== Committers new to Git  ===
Line 32: Line 10:
 
*Read [http://tom.preston-werner.com/2009/05/19/the-git-parable.html The Git Parable]
 
*Read [http://tom.preston-werner.com/2009/05/19/the-git-parable.html The Git Parable]
 
*Have the [http://wiki.sourcemage.org/Git_Guide Git Guide] handy  
 
*Have the [http://wiki.sourcemage.org/Git_Guide Git Guide] handy  
 +
*Also, check out [http://eclipse.org/egit/ EGit]
 +
*Consider [[Git/Editing your Eclipse project Website using Orion|editing your Eclipse project website using Orion]]
 +
*<strike>Consider [[Git/Editing your Eclipse project Website using OrionHub|editing your Eclipse project website using OrionHub]]</strike>
 
*Note that anyone can commit to '''their''' repo, but only Eclipse committers can push their repo to git.eclipse.org  
 
*Note that anyone can commit to '''their''' repo, but only Eclipse committers can push their repo to git.eclipse.org  
*'''DON'T FORGET to configure your git environment'''
+
*'''DON'T FORGET to configure your git environment'''.  The 'commit' record must contain either your Eclipse User ID, or the email address registered with the Eclipse Foundation.
  
 
     git config --global user.email my_committer_email@address.com
 
     git config --global user.email my_committer_email@address.com
Line 44: Line 25:
  
 
This will set the username and email address on just the current git repository.
 
This will set the username and email address on just the current git repository.
 +
 +
=== Git or Gerrit? ===
 +
 +
All new repositories at Eclipse.org now use Gerrit for access, even if the project does not make use of its code review features.  Some mature projects are still using Git. To find out what the project uses, please ask the project, or find the repository on http://git.eclipse.org/c/[[File:Gerrit.png|border|cGit repository browser at http://git.eclipse.org/c/]]
 +
 +
When looking at the repositories, those using the Gerrit Code Review tool are identified as such.  Please see [[Gerrit|Gerrit]] for more on Gerrit Code Review.
 +
 +
=== Your Git identity at eclipse.org ===
 +
Your correct Git committer_id identity is at eclipse.org can be found on the [https://git.eclipse.org/r/#/settings/ Gerrit settings page].  Your user ID is the same for SSH Git and Gerrit.
 +
 +
Note that it is NOT the same as your wiki.eclipse.org Username (which is essentially your email address), or bugs.eclipse.org Email Address.
 +
 +
Your Git password is your Eclipse.org site account password as set on https://dev.eclipse.org/site_login/myaccount.php.
 +
 +
Gerrit maintains its own password for https: https://git.eclipse.org/r/#/settings/http-password.  Gerrit also maintains its own SSH keys: https://git.eclipse.org/r/#/settings/ssh-keys  These passwords and keys are only used for Gerrit and are not interchangeable with the eclipse.org credentials.  Gerrit over SSH does not permit password authentication.  A public key must be uploaded for Gerrit over SSH.
 +
 +
If your firewall blocks SSH (port 22) and Gerrit SSH (29418) please try the https:// URLs provided by Gerrit.
  
 
=== Connecting, cloning a repo  ===
 
=== Connecting, cloning a repo  ===
Line 51: Line 49:
 
Committer access:  
 
Committer access:  
  
     git clone ssh://committer_id@git.eclipse.org/gitroot/project/repo
+
     git clone ssh://committer_id@git.eclipse.org:29418/project/repo
     git clone https://committer_id@git.eclipse.org/gitroot/project/repo (if enabled for your repository)
+
     git clone https://committer_id@git.eclipse.org/r/a/project/repo  
  
Committer access via https is disabled (and discouraged), but it is available. Please ask Webmaster if you absolutely need commit access over https.  
+
These services are provided via Gerrit.
  
 
<br> Anonymous, read-only access:  
 
<br> Anonymous, read-only access:  
  
     git clone git://git.eclipse.org/gitroot/project/repo
+
     git clone git://git.eclipse.org/r/project/repo
     git clone http://git.eclipse.org/gitroot/project/repo
+
     git clone http://git.eclipse.org/r/project/repo
  
Examples:
 
 
    git clone ssh://droy@git.eclipse.org/gitroot/babel/org.eclipse.babel.server.git
 
    git clone git://git.eclipse.org/gitroot/babel/org.eclipse.babel.server.git
 
  
 
=== Committing and pushing  ===
 
=== Committing and pushing  ===
Line 70: Line 64:
 
[[Image:Git.png|thumb|The wrong way]]  
 
[[Image:Git.png|thumb|The wrong way]]  
  
[[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.  
+
[[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 user ID and/or email address stored in the commit transaction in your repository will not match your committer ID and/or email address of your Eclipse Committer record with the Eclipse Foundation, and your push will fail.
  
 
=== IP process implications of DVCS ===
 
=== IP process implications of DVCS ===
Line 76: Line 70:
 
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 76:
 
     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'''
 
    Jane Committer is Author of code. Commits to her local repo.
 
    Jane Committer pushes (publishes) to another committer's local repo.
 
    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'''
+
     '''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, 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 99:
 
     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 107: Line 111:
 
=== Creating a new repository  ===
 
=== Creating a new repository  ===
  
Webmaster can create a new repository for you. Just [https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Community&component=Git open a bug] against Eclipse Foundation &gt; Community &gt; Git. However, Eclipse committers with shell accounts can create new repositories:
+
Please file a bug(community -> git) if your project needs a new repository created.
  
    initrepo /gitroot/project/org.eclipse.repo.name.git
+
==== Using Markdown for README/CONTRIBUTING ====
 
+
The cGit web view at http://git.eclipse.org/c/ supports rendering a Markdown, HTML or plaintext file in the root of the repository, in the master branch, as the "About" tab. In the root of the repository, the file names below are searched (in the order listed). Note: case is important. Such as a file name of "README.MD" will not trigger the "About" tab to be displayed, even though though the <url>/about/ will still display the markup.
For consistency, the name of the repository '''must''' end with .git.  
+
 +
*CONTRIBUTING
 +
*CONTRIBUTING.md
 +
*README.md
 +
*readme.md
 +
*README.mkd
 +
*readme.mkd
 +
*README.rst
 +
*readme.rst
 +
*README.html
 +
*readme.html
 +
*README.htm
 +
*readme.htm
 +
*README.txt
 +
*readme.txt
 +
*README
 +
*readme
 +
*INSTALL.md
 +
*install.md
 +
*INSTALL.mkd
 +
*install.mkd
 +
*INSTALL.rst
 +
*install.rst
 +
*INSTALL.html
 +
*install.html
 +
*INSTALL.htm
 +
*install.htm
 +
*INSTALL.txt
 +
*install.txt
 +
*INSTALL
 +
*install
  
 
=== Permanently deleting code from Git  ===
 
=== Permanently deleting code from Git  ===
Line 119: Line 153:
 
=== 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].''']
+
Please login to Gerrit(https://git.eclipse.org/r) to manage your public keys for ssh access.
  
To avoid having to type in your password for each interaction with the server when using git from the command line:
+
=== Referencing git repositories on the wiki ===
  
*Generate a public/private key pair if you don't already have one on your own machine
+
To include a reference to your Git repository on your wiki page, you can use the [[Template:Git|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:
*sftp committer_id@git.eclipse.org and transfer the id_xxx.pub files from your .ssh directory
+
*ssh committer_id@git.eclipse.org
+
*mkdir .ssh
+
*chmod 700 .ssh
+
*cd .ssh
+
*cat ../id_xxx.pub &gt;&gt;authorized_keys (for each .pub file you transferred)
+
*chmod 600 authorized_keys
+
  
['''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.''']
+
{{Git|ecf|org.eclipse.ecf.git}}
  
=== Setting up https for pushing<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>
+
=== You don't need Git to get code from repository ===
<pre>[core]
+
        repositoryformatversion = 0
+
        filemode = true
+
        bare = false
+
        logallrefupdates = true
+
[remote "origin"]
+
        fetch = +refs/heads/*:refs/remotes/origin/*
+
        url = https://dtenev@git.eclipse.org/gitroot/webtools/incubator/org.eclipse.webtools.incubator.sieditor.git
+
[branch "master"]
+
        remote = origin
+
        merge = refs/heads/master
+
[http]
+
proxy = http://proxy:8080
+
[user]
+
name = dtenev
+
email = dimitar.tenev@some.com
+
</pre>
+
It is configured for the following git project (notice that you got the 'c' letter into the following path): [https://git.eclipse.org/c/webtools/incubator/org.eclipse.webtools.incubator.sieditor.git/ https://git.eclipse.org/c/webtools/incubator/org.eclipse.webtools.incubator.sieditor.git/] <br>
+
  
Do notice few things:<br>
+
As mentioned in {{bug|329841}} you can use the [http://git.eclipse.org/c/ 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.
  
*URL to the remote contains user's name. Git will require your password on '''git push''' execution. <br>
+
* This is useful for things like checking out test scripts, say to a hudson slave, there you just need the files to
*URL to the remote does not contain the 'c' letter from the https browse URL above.<br>
+
start a larger test process, such as using Ant's get task to get a URL such as
  
You may be curious to see the bugzilla issue ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=326992 https://bugs.eclipse.org/bugs/show_bug.cgi?id=326992]) which enabled https push in git repository, and do lead to the above contents of ''.gitconfig'' file.<br>
+
http://git.eclipse.org/c/platform/eclipse.platform.releng.eclipsebuilder.git/snapshot/master.zip
  
=== Referencing git repositories on the wiki ===
+
* It can also be useful to refer to a single file for (temporary) reference or review, such as
 +
 +
http://git.eclipse.org/c/platform/eclipse.platform.common.git/plain/bundles/org.eclipse.platform.doc.isv/porting/4.2/incompatibilities.html?h=R4_HEAD#help-appserver
  
To include a reference to your Git repository on your wiki page, you can use the [[Template:Git|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:
+
=== Gerrit Code Review ===
 +
If you want to add code review to your Git tool box then see [[Gerrit|Gerrit]].
  
{{Git|ecf|org.eclipse.ecf.git}}
+
= 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.
  
=== GitHub mirrors ===
+
*[[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://git-scm.com/ Git SCM] - the main git site
 +
*[http://code.google.com/p/msysgit/ msysgit] - A git client and bash shell for windows - might need some crlf flags set, not sure.
 +
* [http://sandofsky.com/blog/git-workflow.html Git workflows] - a blog post about Git workflows
 +
* [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
  
[http://git.eclipse.org Git repositories] hosted on eclipse.org are now mirrored at GitHub.
+
= Recommended Practices=
  
See the [[Git/GitHub]] wiki page on Eclipsepedia for more information.
+
* 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.
 +
** Please see '''[[Development_Resources/Handling_Git_Contributions|Handling Git Contributions]]''' for further information.
  
The Eclipse organization at GitHub is maintained by:
 
  
* [mailto:caniszczyk@gmail.com Chris Aniszczyk]
+
[[Category:Git]]
* [mailto:wayne@eclipse.org Wayne Beaton]
+

Revision as of 10:32, 23 August 2017

List of Git repositories available

Please see http://git.eclipse.org/.

Committers new to Git

Before working on a Git repository, please:

   git config --global user.email my_committer_email@address.com
   git config --global user.name "John Doe"
  • Note that the above will set this as the default user name and email address to use when writing commits. You can set user.name and password on a per repository basis.
   git config user.email my_committer_email@address.com
   git config user.name "John Doe"

This will set the username and email address on just the current git repository.

Git or Gerrit?

All new repositories at Eclipse.org now use Gerrit for access, even if the project does not make use of its code review features. Some mature projects are still using Git. To find out what the project uses, please ask the project, or find the repository on http://git.eclipse.org/c/cGit repository browser at http://git.eclipse.org/c/

When looking at the repositories, those using the Gerrit Code Review tool are identified as such. Please see Gerrit for more on Gerrit Code Review.

Your Git identity at eclipse.org

Your correct Git committer_id identity is at eclipse.org can be found on the Gerrit settings page. Your user ID is the same for SSH Git and Gerrit.

Note that it is NOT the same as your wiki.eclipse.org Username (which is essentially your email address), or bugs.eclipse.org Email Address.

Your Git password is your Eclipse.org site account password as set on https://dev.eclipse.org/site_login/myaccount.php.

Gerrit maintains its own password for https: https://git.eclipse.org/r/#/settings/http-password. Gerrit also maintains its own SSH keys: https://git.eclipse.org/r/#/settings/ssh-keys These passwords and keys are only used for Gerrit and are not interchangeable with the eclipse.org credentials. Gerrit over SSH does not permit password authentication. A public key must be uploaded for Gerrit over SSH.

If your firewall blocks SSH (port 22) and Gerrit SSH (29418) please try the https:// URLs provided by Gerrit.

Connecting, cloning a repo

Please see the list of Git repositories (above).

Committer access:

   git clone ssh://committer_id@git.eclipse.org:29418/project/repo
   git clone https://committer_id@git.eclipse.org/r/a/project/repo 

These services are provided via Gerrit.


Anonymous, read-only access:

   git clone git://git.eclipse.org/r/project/repo
   git clone http://git.eclipse.org/r/project/repo


Committing and pushing

The wrong way
The right way
Before committing code to your cloned repo, please ensure that your Git environment is properly set. Otherwise, the user ID and/or email address stored in the commit transaction in your repository will not match your committer ID and/or email address of your Eclipse Committer record with the Eclipse Foundation, and your push will fail.

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.


Please see Handling Git Contributions for information on how to handle "pull" requests from non-committers.

Creating a new repository

Please file a bug(community -> git) if your project needs a new repository created.

Using Markdown for README/CONTRIBUTING

The cGit web view at http://git.eclipse.org/c/ supports rendering a Markdown, HTML or plaintext file in the root of the repository, in the master branch, as the "About" tab. In the root of the repository, the file names below are searched (in the order listed). Note: case is important. Such as a file name of "README.MD" will not trigger the "About" tab to be displayed, even though though the <url>/about/ will still display the markup.

  • CONTRIBUTING
  • CONTRIBUTING.md
  • README.md
  • readme.md
  • README.mkd
  • readme.mkd
  • README.rst
  • readme.rst
  • README.html
  • readme.html
  • README.htm
  • readme.htm
  • README.txt
  • readme.txt
  • README
  • readme
  • INSTALL.md
  • install.md
  • INSTALL.mkd
  • install.mkd
  • INSTALL.rst
  • install.rst
  • INSTALL.html
  • install.html
  • INSTALL.htm
  • install.htm
  • INSTALL.txt
  • install.txt
  • INSTALL
  • install

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

Please login to Gerrit(https://git.eclipse.org/r) to manage your public keys for ssh access.

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:

org.eclipse.ecf.git (browse, stats, fork on OrionHub)


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

http://git.eclipse.org/c/platform/eclipse.platform.releng.eclipsebuilder.git/snapshot/master.zip 
  • It can also be useful to refer to a single file for (temporary) reference or review, such as
http://git.eclipse.org/c/platform/eclipse.platform.common.git/plain/bundles/org.eclipse.platform.doc.isv/porting/4.2/incompatibilities.html?h=R4_HEAD#help-appserver

Gerrit Code Review

If you want to add code review to your Git tool box then see 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 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.

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.
    • Please see Handling Git Contributions for further information.

Back to the top