T3DD10/CoreTeamGitWorkshop
From TYPO3Wiki
- Nice Links:
- change gerrit IP -- 192.168.100.75
Contents |
CREATING A PROJECT (only needed for admins)
- Create Project:
- ssh -p 29418 sebastian@localhost gerrit create-project -d T3v4Core -n TYPO3v4/Core
- Clone Git repo
- git svn clone -s https://svn.typo3.org/TYPO3v4/Core/
- Make tags real tags:
- Alternative 2: http://stackoverflow.com/questions/1584675/converting-svn-to-git-how-to-get-the-branches-not-to-be-just-remote-in-the-svn-r
- in .git/packed-refs: do the following search replace through vim:
- :%s/refs\/remotes\/tags/refs\/tags/g
- :%s/refs\/remotes/refs\/heads/g
- Delete Trunk (as it is now called "master"):
- git branch -d trunk
- Im Gerrit müssen die Rechte "Push Branch" und "Push Tag" aktiv sein für den Admin, der das Merge macht; außerdem "Forge Identity" auf "+2" gestellt sein
- git remote add origin ssh://sebastian@localhost:29418/TYPO3v4/Core
- git push origin --all
INITIAL SETUP FOR USERS
- Login with OpenID (httpS://skurfuerst...)
- Set settings (username and ssh key)
- Download a local checkout:
- git clone ssh://sebastian@localhost:29418/TYPO3v4/Core
- IF YOU USED THE TAR:
- git remote rm origin
- git remote add origin ssh://USERNAME@192.168.100.75:29418/TYPO3v4/Core
- Change into checkout directory
- Install commit-message hook
- cd .git/hooks/; wget http://192.168.100.75/tools/hooks/commit-msg
While doing setup you should do the initial git setup as well:
- git config --global user.name "John Doe"
- git config --global user.email johndoe@example.com
See http://progit.org/book/ch1-5.html for details.
ADDING A NEW REVIEW REQUEST
- Create a new branch for the feature (we call it my_feature_branch, below we take TYPO3 4.1 as basis)
- git branch my_feature_branch origin/TYPO3_4-1
- We have to change to the new feature branch:
- git checkout my_feature_branch
- do your work
- commit your changes (locally)
- git commit -a
- push the changes to the review system (in our case to branch TYPO3 4_1)
- git push origin my_feature_branch:refs/for/TYPO3_4-1
- Delete your feature branch locally
- git branch -D my_feature_branch
CHECKING OUT A REVIEW REQUEST
- Go to the gerrit web UI
- copy and paste the git command to check out:
- git fetch ssh://sebastian@localhost:29418/TYPO3v4/Core refs/changes/01/1/2 && git checkout FETCH_HEAD
- review and do changes
- Now, in case you want to commit your reviewed changes again, do the following:
- git commit --amend -a
- git push origin HEAD:refs/for/TYPO3_4-1
- That's it :-) Your changes are now appended as patch set 2.