-
Notifications
You must be signed in to change notification settings - Fork 7
Obtain Source Code
Xin Yang edited this page Jun 8, 2016
·
1 revision
In this example, we obtain the diff of commits (revisions) in the source code repositories of OpenStack Nova Project.
- Clone the repositories.
git clone https://git.openstack.org/openstack/nova
- Check the patchsets (revisions) of changes. For example, we examine a patchset (change-id = 176805). You will get a list of patchsets of this change.
git ls-remote | grep /176805/
- Get the revisions and create new branches. Here we create two new branches based on patchset 1 and patchset 2.
git fetch https://review.openstack.org/openstack/nova refs/changes/05/176805/1
git branch change/176805/1 FETCH_HEAD
git fetch https://review.openstack.org/openstack/nova refs/changes/05/176805/2
git branch change/176805/2 FETCH_HEAD
- Compare the diff file. You can also save the diff to local.
git diff change/176805/1 change/176805/2
or
git diff change/176805/1 change/176805/2 > diff-176805-1-2.txt
(Similar shell script to fetch all the diff, please check https://github.com/saper/gerrit-fetch-all/blob/master/gerrit-fetch-all)