git-tutorial
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Last revisionBoth sides next revision | ||
git-tutorial [2017/10/31 17:21] – oofem git repo updated to github bp | git-tutorial [2017/11/01 08:56] – updated to github workflow bp | ||
---|---|---|---|
Line 119: | Line 119: | ||
====== Contributing to OOFEM - Practical workflow ====== | ====== Contributing to OOFEM - Practical workflow ====== | ||
- | Contributing | + | For people without write permissions |
- | **Before contributing, | + | You can read more about [[https:// |
- | First, you’ll probably want to clone the main repository, create | + | Typically, one have to create a fork, or copy, of the repository. Forks let you make changes to a project without affecting |
+ | * Read more about [[https:// | ||
+ | * [[https:// | ||
- | Clone reference | + | If you have write access to the repository, you can also create branch directly within oofem repository. This should be reserved |
- | | + | |
- | $ cd oofem.git | + | |
- | Note: when a repository is cloned, git automatically creates a master branch that tracks origin/ | ||
- | If you already | + | After you have created |
+ | In OOFEM, these people ('lieutenants') are in charge of a specific subsystem of the project and they merge in all changes related to that subsystem and push them to the reference (blessed) repository that everyone can clone from again. | ||
- | $ (git diff --name-only master origin/ | + | **Before contributing, |
- | $ git checkout master | + | |
- | $ git pull --rebase | + | |
- | Normally, we do not want to modify '' | ||
- | $ git checkout -b featureA | ||
- | $ (work) | ||
- | |||
- | Locally modified files need to be uploaded to local server. Use option '' | ||
- | |||
- | $ git commit -a | ||
- | $ (work) | ||
- | $ git commit -a | ||
- | |||
- | |||
- | Now, while you are working hard on your new feature, other developers complete theirs and push their changes to the remote '' | ||
- | |||
- | $ git checkout master | ||
- | $ git pull --rebase | ||
- | | ||
- | Now, to make merging your code easy, you should rebase your '' | ||
- | |||
- | $ git checkout featureA | ||
- | $ git rebase master | ||
- | |||
- | |||
- | :!: **It is stronlgly recommended to use '' | ||
- | ** | ||
- | |||
- | Optionally, your branch can be merged into single '' | ||
- | |||
- | $ git checkout master | ||
- | $ git merge featureA | ||
- | $ git branch -D featureA | ||
- | |||
- | Now you have your commits that you want to send to the maintainers. You use git format-patch to generate the mbox-formatted files that you can e-mail — it turns each commit into an e-mail message with the first line of the commit message as the subject and the rest of the message plus the patch that the commit introduces as the body. | ||
- | |||
- | $ git format-patch -M origin/ | ||
- | 0001-add-limit-to-log-function.patch | ||
- | 0002-changed-log-output-to-30-from-25.patch | ||
- | |||
- | The format-patch command prints out the names of the patch files it creates. The -M switch tells Git to look for renames. | ||
- | To e-mail this to a maintainers, | ||
- | |||
- | For those, who have write access to remote server, the local repository can be uploaded to remote server. Without any options, all branches, where local_name=remote_name will be pushed | ||
- | |||
- | $ git push | ||
- | |||
- | To be sure pushing only '' | ||
- | |||
- | $ git push origin master | ||
===== Maintainers ===== | ===== Maintainers ===== | ||
Line 190: | Line 142: | ||
====== Links ====== | ====== Links ====== | ||
- | * Online version of [[http://git-scm.com/book|Git book]]. Higly recommended! | + | * Online version of [[https://help.github.com/|GitHub help]]. Higly recommended! |
- | * Git-SVN [[http:// | + | |
git-tutorial.txt · Last modified: 2017/11/01 09:08 by bp