diff options
author | Joe Rayhawk <jrayhawk@freedesktop.org> | 2013-05-18 02:08:25 -0700 |
---|---|---|
committer | Joe Rayhawk <jrayhawk@freedesktop.org> | 2013-05-18 02:08:25 -0700 |
commit | 79f60d3af07ae9a372f97f8446a62beac27c477e (patch) | |
tree | bd8c1148eda2a14968f963a0e70bed6f07cc8f7b /Software/ooo-build/GettingIt.mdwn | |
parent | b105f7a864ee39ad4ec976abb8dba59954e9467b (diff) |
moin2mdwn: convert page Software/ooo-build/GettingIt
Diffstat (limited to 'Software/ooo-build/GettingIt.mdwn')
-rw-r--r-- | Software/ooo-build/GettingIt.mdwn | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/Software/ooo-build/GettingIt.mdwn b/Software/ooo-build/GettingIt.mdwn new file mode 100644 index 00000000..388f7372 --- /dev/null +++ b/Software/ooo-build/GettingIt.mdwn @@ -0,0 +1,100 @@ + +[[!toc ]] + + +## Getting the sources + +ooo-build sources are stored in [[git|http://git-scm.com/]]. 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|Software/ooo-build/AccountRequestCheatSheet]], 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|Software/ooo-build/Contributing]]. 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|Software/ooo-build/BuildingIt]] pages. + + +## Basic instructions + +Please check our **[[SVN to git cheat sheet|Software/ooo-build/SVNToGitCheatSheet]]** for quick reference. You might be also interested in [[git/hg cheat sheet|http://mercurial.selenic.com/wiki/GitConcepts#Command_equivalence_table]] if you are more a Mercurial person, or if you want to up-stream something. + + +## Getting a particular branch + +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 """ +# remove the master branch in this repository, we are interested only in ooo-build-3-2-1 +git branch -D master +"""]] + +## Getting a particular tag + +To switch your local repository to the given tag, use the following command: +[[!format txt """ +# let's say we want the tag OOO_BUILD_3_0_99_3 +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 """ +# ensure that you have all the tags from the remote repository +git pull -t +# show the tags +git tag +"""]] + +## Getting the latest updates + +We use the same git workflow as described in the [[common freedesktop.org git instructions|Infrastructure/git/Developers]]. 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 the [[Pushing the changes|Software/ooo-build/GettingIt]] section. + +_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 """ +# let git search for the lost commits +git fsck --lost-found +# show them all, together with the patches +git show `cat .git/lost-found/commit/*` +# find the commit ID in the git show, and create a temporary branch +git checkout -b tmpbranch the_ID_you_just_found +# now you have the commit in tmpbranch, and you can do what you need +# (eg. another rebase, or something) +"""]] + +## More info + +* [[I have the ooo-build sources. What next?|Software/ooo-build/]] +* [[git home page|http://git-scm.com/]] +* [[ooo-build SVN to git cheat sheet|Software/ooo-build/SVNToGitCheatSheet]] +* [[freedesktop.org git instructions|Infrastructure/git/Developers]] +* [[freedesktop.org git repo administration|Infrastructure/git/RepositoryAdmin]] - personal repositories, etc. +* [[Pro Git|http://progit.org/book/]] - the Git book
\ No newline at end of file |