- Getting the sources
- Basic instructions
- Getting a particular branch
- remove the master branch in this repository, we are interested only in ooo-build-3-2-1
- Getting a particular tag
- let's say we want the tag OOO_BUILD_3_0_99_3
- ensure that you have all the tags from the remote repository
- show the tags
- Getting the latest updates
- let git search for the lost commits
- show them all, together with the patches
- find the commit ID in the git show, and create a temporary branch
- now you have the commit in tmpbranch, and you can do what you need
- (eg. another rebase, or something)
- More info
ooo-build sources are stored in git. To clone the latest version of ooo-build, please use:
[[!format txt """
git clone git://anongit.freedesktop.org/git/ooo-build/ooo-build
Registered developers should use the following command to enable writing to the repository:
[[!format txt """
git clone ssh://[username@]git.freedesktop.org/git/ooo-build/ooo-build
If you asked for your account, but did not get one yet, just clone from the anonymous repository, you can commit and update (
git pull -r) immediately, and push the changes later when you have the read/write access. You can also send the changes by mail. To change your anonymous clone into a read/write (after you got the write access), change the URL in .git/config from the anonymous URL to the read/write.
To learn how to build your fresh ooo-build clone, continue with the BuildingIt pages.
When you have cloned the repository, you can switch to any branch you need. The bleeding edge development happens in master, which is what you get when you clone the repository. To switch eg. to branch ooo-build-3-2-1, do: [[!format txt """ git checkout -b ooo-build-3-2-1 origin/ooo-build-3-2-1 """]] This exactly means "please create a local branch ooo-build-3-2-1 that tracks what's happening in the remote branch ooo-build-3-2-1". You can get a list of all the available remote branches using git branch -r.
Once you have created the branch(es), you can switch between them using git checkout: [[!format txt """ git checkout master git checkout ooo-build-3-2-1 """]] Note: You might want to keep the older ooo-build branches in separate locations. When you have cloned ooo-build master to eg. ~/ooo-build, you can use the --reference feature of git clone to save bandwidth: [[!format txt """ git clone --reference ~/ooo-build \ ssh://[username@]git.freedesktop.org/git/ooo-build/ooo-build ooo-build-3-2-1 cd ooo-build-3-2-1 git checkout -b ooo-build-3-2-1 origin/ooo-build-3-2-1 """]] We recommend you to have the branch you are interested in as the only branch there: [[!format txt """
git branch -D master """]]
To switch your local repository to the given tag, use the following command: [[!format txt """
git checkout -b tag-OOO_BUILD_3_0_99_3 OOO_BUILD_3_0_99_3 """]] This exactly means "please create a local branch tag-OOO_BUILD_3_0_99_3 that shows the state of the sources when the tag OOO_BUILD_3_0_99_3 was created". For the operations like diff, log, etc. you don't have to create the branch; just directly do [[!format txt """ git log OOO_BUILD_3_0_99_3 git diff OOO_BUILD_3_0_99_3 master """]] The tags are created for released sources, branches or some specific commits. To list them all, use: [[!format txt """
git pull -t
git tag """]]
We use the same git workflow as described in the common freedesktop.org git instructions. The reasoning is simple - using just the git pull (without the -r) tends to create too many unnecessary 'merge' commits when there are more people working on one repository - and this is what we want to avoid.
So, to get the updates, use [[!format txt """ git pull -r """]] Please, do not forget the -r ! - -r means that instead of merging, git pull rebases your local changes against the changes from the remote repository. See also thesection.
Note: Using rebase might be dangerous, and can lead to a situation when you seemingly lose a commit. Don't worry, nothing is lost with git - after the finished git pull -r do the following: [[!format txt """
git fsck --lost-found
git checkout -b tmpbranch the_ID_you_just_found