GitSetup
Jump to navigation
Jump to search
Ubuntu Lucid 10.04 LTS[edit | edit source]
Requires a newer version of git:
sudo apt-get install python-software-properties sudo add-apt-repository ppa:pdoes/ppa sudo apt-get update sudo apt-get remove git-core sudo apt-get install git
Git repos (direct)[edit | edit source]
git clone http://embedded.ventureresearch.com/git/linux-omap3/venture
Android repo/git usage[edit | edit source]
checkout[edit | edit source]
cd <your-android-root-dir> wget http://android.embedded.ventureresearch.com/git/repo chmod +x repo ./repo init -u http://android.embedded.ventureresearch.com/git/manifest.git ./repo sync (takes 15-20 minutes to fetch)
usage[edit | edit source]
http://source.android.com/source/version-control.html http://gerrit-documentation.googlecode.com/svn/Documentation/2.5.1/intro-quick.html
- Start a branch to hold your changes
cd ~/android-dev
./repo start <branch name> <project>
# example: ./repo start no-statusbar frameworks/base
- Write your code
- Stage your changes
cd frameworks/base/ git add .
- Commit your changes to the branch
cd frameworks/base/ git commit -m "this is a comment"
# or add and commit at the same time git commit -t -m "this is a comment"
- When you're done with your changes and you want to push it back into the main branch...
cd ~/android-dev
./repo upload
- Now go to the Gerrit web site and approve your changes. http://gerrit.embedded.ventureresearch.com
- When you're finished with the development branch, you can "prune" it.
./repo prune
showing differences[edit | edit source]
git status git diff git log -1 (history)
local check-in[edit | edit source]
~ ~ make some changes ~ ~
(it's easier if you are on a branch first)
git branch mybranch git checkout mybranch git add <files you have changed> git commit
remote check-in[edit | edit source]
checkout the main development branch (see branches)
git checkout -b rowboat-ics -t venture/rowboat-ics
merge your changes in with the master branch
git merge mybranch
push to git server
git push venture rowboat-ics
new git repo[edit | edit source]
- create git repo somewhere
- clone --mirror into embedded-prod /var/lib/git-android (master git repo)
on *embedded-prod*
git clone --mirror ssh://wherever@embedded-dev/wherever
- chown -R www-data:users <directory> (so gerrit can get to it)
- vi <android-root>/.repo/manifest.xml
- check in manifest (cd .repo/manifests; git commit -am "message"; git checkout master; git rebase default; git checkout default; git push)