git-tutorial
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
git-tutorial [2012/12/04 16:55] – Changes reflecting new repo structure (master=development branch, stable branch for releases) bp | git-tutorial [2012/12/29 23:46] – smilauer | ||
---|---|---|---|
Line 18: | Line 18: | ||
git config --global user.email " | git config --global user.email " | ||
- | ====== Git Basics ====== | + | ====== Git Basics |
Our two main branches are: | Our two main branches are: | ||
Line 118: | Line 118: | ||
- | ====== Contributing to OOFEM ====== | + | ====== Contributing to OOFEM - Practical workflow |
Contributing to oofem project is different. Typically, you don’t have the permissions to directly update branches on the project reference repository and you have to pass your contribution(s) to the maintainers in some way. In OOFEM, these people (' | Contributing to oofem project is different. Typically, you don’t have the permissions to directly update branches on the project reference repository and you have to pass your contribution(s) to the maintainers in some way. In OOFEM, these people (' | ||
Line 126: | Line 126: | ||
Clone reference repository from remote server. This creates only '' | Clone reference repository from remote server. This creates only '' | ||
- | |||
$ git clone http:// | $ git clone http:// | ||
$ cd oofem.git | $ cd oofem.git | ||
- | Note: when a repository is cloned, git automatically creates a master branch that tracks origin/masterhe | + | Note: when a repository is cloned, git automatically creates a master branch that tracks origin/ |
+ | |||
+ | If you already have oofem.git directory from a previous time, you can update '' | ||
+ | |||
+ | $ (git diff --name-only master origin/ | ||
+ | $ git checkout master | ||
+ | $ git pull --rebase | ||
Normally, we do not want to modify '' | Normally, we do not want to modify '' | ||
Line 136: | Line 141: | ||
$ (work) | $ (work) | ||
- | Locally modified files need to be uploaded to local server. Use option '' | + | Locally modified files need to be uploaded to local server. Use option '' |
$ git commit -a | $ git commit -a | ||
$ (work) | $ (work) | ||
$ git commit -a | $ 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 '' | :!: **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. | 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-tutorial.txt · Last modified: 2017/11/01 09:08 by bp