The iOS app development team is using Gerrit for code review. The following instructions assume you're using a recent version of Mac OS X.
If you are new to Git I suggest you take the time to read the first three chapters of the official git book, this will simplify your life later.
If you don't read it now, at least come back to it after you are thoroughly frustrated with Git.
Here is a link to an introduction to the Gerrit Code Review tool.
We have come up with a Common Workflow that will help you be more productive and avoid common pitfalls. Please read and follow it.
Here is an
git clone https://tech.lds.org/mobile/codereview/p/PROJECT
cd PROJECT git submodule update --init --recursive
curl https://tech.lds.org/mobile/codereview/tools/hooks/commit-msg > .git/hooks/commit-msg chmod u+x .git/hooks/commit-msg
git config remote.origin.push HEAD:refs/for/master
git config --global user.name "Your Name" git config --global user.email "[email protected]"
If you have already committed with the wrong information, you can:
git commit --amend --author="Author NameIf there are multiple commits with the wrong information, follow these more in-depth steps."
git checkout master
git pull origin master
git checkout -b
git diff git status
git commit -a
You'll be asked to enter a commit message. Use the following format:
(PROJECT-245) Short summary of change (~50 chars max, issue ID in parentheses if applicable) A more elaborate summary of the committed changes and suggested tests. May have bullet points or paragraphs. Break at 72 chars. This is shown when users view the full commit.
git pushYou will be asked for your username (LDS Account username) and password (LDS Account password).
We recommend you use git credential caching, here's how you set up git to cache your username and password.
The code review process exists to maintain a high level of code quality, to make sure that more than one set of eyes has seen every line of code, and to provide an opportunity for both the contributor and the reviewer to learn. It is rare that any code review request does not require some change, even if minor. When that happens:
git diff git status
git commit -a --amend git push
If you get the error "Your change could not be merged due to a path conflict" when submitting a change set in the code review tool, you need to resolve the conflict by following these steps:
Many build/run problems can be solved by doing one or all of the following:
git rebase -i HEAD~3(that's dash i and tilde 3)
pick f7f3f6d changed my name a bit s 310154e updated README formatting and added blame s a5f4a0d added cat-file
:wq
WARNING: This will lose all of your uncommitted or unstashed changes.
To get rid of uncommitted changes, perform git reset --hard HEAD.
If you want to get rid of them temporarily, do git stash.
WARNING: These steps will get rid of all of your unpublished changes on the branch you perform this on, even if they have been committed to that branch. (If they have been committed to a separate branch or stashed (Google "git stash"), they should be fine, but be careful.)
If you get into a state that you don't like and you want to blow away your changes and get to a clean state, follow these steps on your preferred branch (most likely branch master):
If this doesn't work, use one of the destructive blunt instruments described on Stack Overflow.
git config --global diff.tool opendiff
git config --global merge.tool opendiff
By default, mergetool keeps ".orig" backup files. To disable this, run git config --global mergetool.keepBackup false.
This page was last modified on 4 December 2013, at 15:15. This page has been accessed 6,903 times.