This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
geda:scm [2015/10/27 16:40] kaimartin [Track a branch] this is about feature branches |
geda:scm [2016/08/04 12:35] (current) kaimartin [Track a feature branch] removed spurious brackets |
||
---|---|---|---|
Line 5: | Line 5: | ||
* [[http://git.or.cz/|official git website]] | * [[http://git.or.cz/|official git website]] | ||
* [[http://www.kernel.org/pub/software/scm/git/docs/|git documentation online]] | * [[http://www.kernel.org/pub/software/scm/git/docs/|git documentation online]] | ||
- | * [[wp>Git_(software)|git Wikipedia page]] | ||
Some nice tutorials: | Some nice tutorials: | ||
- | * [[http://wiki.sourcemage.org/Git_Guide|Git Guide]] | + | * [[https://www.atlassian.com/git/tutorials/|comprehensive set of tutorials]] at atlassian.com |
- | * [[https://www.atlassian.com/git/tutorials/|Comprehensive set of Tutorials at Atlassian]] | + | * [[https://git.wiki.kernel.org/index.php/GitSvnCrashCourse|GitSvnCrashCourse]] -- git courses for SVN users |
- | * [[https://git.wiki.kernel.org/index.php/GitSvnCrashCourse|git Crash Courses]] | + | * [[http://git.huit.harvard.edu/guide/| Git - The Simple Guide]] -- very concise and condensed cheat sheet style tutorial |
===== Read-only access the geda repositories ===== | ===== Read-only access the geda repositories ===== | ||
Line 29: | Line 28: | ||
==== List all branches of a project ==== | ==== List all branches of a project ==== | ||
- | To list all branches of a project available on the geda-project server emit this command: | + | To list all branches of a project available on the geda-project server cd to your local copy of the project and emit this git command: |
- | <code>$ git ls-remote git://git.geda-project.org/geda-gaf.git</code> | + | <code>$ git branch -r</code> |
==== Track a feature branch ==== | ==== Track a feature branch ==== | ||
- | This will create a branch with the name ''<local name>'' in your local repository, which tracks the <remote name>'d branch. | + | This will create a branch with the name ''<local name>'' in your local repository, which tracks the ''<remote name>'''d branch. |
<code>$ git checkout --track -b <local name> origin/<remote name></code> | <code>$ git checkout --track -b <local name> origin/<remote name></code> | ||
+ | Go ahead and build the application from the branch as described by the [[geda:gaf_building_git_version|build instructions]]. By default the command ''make install'' will copy the binaries to ''/usr/local/*''. That way, it will not interfere with an install done by your linux distribution. You may use full paths, symbolic links or aliases to pick which version to use. | ||
==== Communicate your experience ==== | ==== Communicate your experience ==== | ||
Line 40: | Line 39: | ||
For additional visibility you may report your experience on the mailing list [[geda:mailinglists|geda-user]]. It may even spark a discussion. As with all forms of general online discussion, the note may get archived and gradually be forgotten without any action taken. | For additional visibility you may report your experience on the mailing list [[geda:mailinglists|geda-user]]. It may even spark a discussion. As with all forms of general online discussion, the note may get archived and gradually be forgotten without any action taken. | ||
+ | |||
+ | ===== Format a patch to send to the developers ===== | ||
+ | The simplest possible way includes all changes since the local repository was syncronized with the repository at geda-project.org: | ||
+ | $ git diff > name_of_patchfile | ||
+ | |||
+ | A more complicated way with more control on what the patch contains: | ||
+ | $ git add -i # select files to be committed | ||
+ | $ git status # check you're committing what you think you're committing | ||
+ | $ git commit # create a commit | ||
+ | $ git format-patch -1 # create a patch file based on that commit | ||
+ | This will output a filename which contains the patch. Be sure to look at the documentation for format-patch for more information. This file can be e-mailed to developers who have write access and can be applied using git apply. | ||
===== Access the repository with write permission ===== | ===== Access the repository with write permission ===== | ||
Line 59: | Line 69: | ||
Having this done, your local clone works just as before, just a ''git push origin <branch>'' succeeds. | Having this done, your local clone works just as before, just a ''git push origin <branch>'' succeeds. | ||
- | === A key unique for gEDA === | + | ==== Use a unique SSH key for gEDA ==== |
You can use a separate key for accessing the gEDA git access. This has no further advantage other than having a unique key. In this case you may also need to add a line to your ~/.ssh/config file to specify this alternate key: | You can use a separate key for accessing the gEDA git access. This has no further advantage other than having a unique key. In this case you may also need to add a line to your ~/.ssh/config file to specify this alternate key: | ||
- | + | <code> | |
- | Host git.geda-project.org | + | Host git.geda-project.org |
- | Port 65 | + | Port 65 |
- | IdentityFile ~/.ssh/gedaproject_dsa | + | IdentityFile ~/.ssh/gedaproject_dsa |
- | + | </code> | |
- | Note that the file you refer to here is the private key, where the file you send for the server side is the corresponding public key. | + | Note, the file you refer to here is the private key. By contrast, the file you send for the server side is the corresponding public key. |
===== Commit changes ===== | ===== Commit changes ===== | ||
Line 100: | Line 110: | ||
They may have other work based on their patch and will want to know if there were changes to the applied version. | They may have other work based on their patch and will want to know if there were changes to the applied version. | ||
- | Note: //This is easy to miss accidentally if your editor introduces tabs. Please avoid letting it do so!// | + | <note>This is easy to miss accidentally if your editor introduces tabs. Please avoid letting it do so!</note> |
For every file changed, added or removed, you need to inform git before it will commit the changes. To see the modified files, run: | For every file changed, added or removed, you need to inform git before it will commit the changes. To see the modified files, run: | ||
Line 246: | Line 256: | ||
Updating favourite remotes will then boil down to: | Updating favourite remotes will then boil down to: | ||
$ git fetch --all | $ git fetch --all | ||
- | | ||
- | ===== format a patch to send to the developers ===== | ||
- | The simplest possible way includes all changes since the local repository was syncronized with the repository at geda-project.org: | ||
- | $ git diff > name_of_patchfile | ||
- | |||
- | A more complicated way with more control on what the patch contains: | ||
- | $ git add -i # select files to be committed | ||
- | $ git status # check you're committing what you think you're committing | ||
- | $ git commit # create a commit | ||
- | $ git format-patch -1 # create a patch file based on that commit | ||
- | This will output a filename which contains the patch. Be sure to look at the documentation for format-patch for more information. This file can be e-mailed to developers who have write access and can be applied using git apply. | ||
===== Recover from a really messed up local repository ===== | ===== Recover from a really messed up local repository ===== |