Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

git remote add upstream git@github.com:apache/incubator-samoa.git
git fetch upstream
git branch -u upstream/master
git remote -v
origin git@github.com:<user>/incubator-samoa.git (fetch)
origin git@github.com:<user>/incubator-samoa.git (push))
upstream git@github.com:apache/incubator-samoa.git (fetch)
upstream git@github.com:apache/incubator-samoa.git (push)

...

As a committer, you have write access to the official Apache git repository. You need to setup a remote pointing to it in order to commit changes.

git remote add apache githttps://git-wip-us.apache.org/repos/asf/incubator-samoa.git
git fetch apache
git remote -v
apache githttps://git-wip-us.apache.org/repos/asf/incubator-samoa.git (fetch)
apache githttps://git-wip-us.apache.org/repos/asf/incubator-samoa.git (push)
origin git@github.com:<user>/incubator-samoa.git (fetch)
origin git@github.com:<user>/incubator-samoa.git (push))
upstream git@github.com:apache/incubator-samoa.git (fetch)
upstream git@github.com:apache/incubator-samoa.git (push)

Anchor
autofetch
autofetch

Fetch pull requests automatically

The easy way to check out a pull request is the followingIf you have troubles using the git repository, you can try with the https address.

git remotefetch addupstream apache https:pull/ID/head:SAMOA-XX
git-wip-us.apache.org/repos/asf/incubator-samoa.git

...

 checkout SAMOA-XX

...

If you review many pull requests, you can setup your git clone to automatically fetch the pull requests from the upstream remote.
The order in which you add the refs is important (pull goes before heads). 

git config --unset remote.upstream.fetch
git config --add remote.upstream.fetch '+refs/pull/*/head:refs/remotes/upstream/pull/*'
git config --add remote.upstream/pr.fetch '+refs/heads/*:refs/remotes/upstream/*'
git fetch upstream
remote: Counting objects: 554, done.
remote: Compressing objects: 100% (58/58), done.
remote: Total 554 (delta 67), reused 40 (delta 40), pack-reused 456
Receiving objects: 100% (554/554), 101.94 KiB | 0 bytes/s, done.
Resolving deltas: 100% (170/170), done.
From github.com:apache/incubator-samoa
* [new ref] refs/pull/1/head -> upstream/prpull/1
* [new ref] refs/pull/2/head -> upstream/prpull/2
* [new ref] refs/pull/3/head -> upstream/prpull/3
* [new ref] refs/pull/4/head -> upstream/prpull/4
* [new ref] refs/pull/5/head -> upstream/prpull/5
* [new ref] refs/pull/6/head -> upstream/prpull/6
* [new ref] refs/pull/7/head -> upstream/prpull/7
* [new ref] refs/pull/8/head -> upstream/prpull/8
* [new ref] refs/pull/9/head -> upstream/pr/9pull/9

You can now check out a pull request simply as follows.

git checkout -b SAMOA-XX upstream/pull/ID

The new local branch will automatically track the pull request.

Source: https://gist.github.com/piscisaureus/3342247 (note that in SAMOA's case pull requests come to the upstream remote rather than the origin one).

Get ready to update the website

Checkout the gh-pages branch that contains website and documentation.

 

...

git checkout -b gh-pages upstream/gh-pages

In a separate directory, check out the currently-published website from SVN.

cd ..
svn checkout https://svn.apache.org/repos/asf/incubator/samoa/site samoa-website