Managing linux-next tree
Hi,
I've been following linux-next tree and base some of my janitorial realted work on this tree. Things are fine, but I think I'm little confused with the git branching/merging stuff. Please find some of the steps that I follow to clone and update my local linux-next tree:
1. Clone the tree (once):
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
So here I've just one branch called master. To work on some code cleanup work etc, I create my private branch (see step 2 below)
2. Create my private branch based on latest tag(every now and then)
$ git tag -l next-*|tail -n 1 next-20130709 $ git checkout next-20130709 $ git checkout -b July-09
So, Now i have two branches; master and July-09, and I commit any changes in July-09 branch. Later (say after some days) I fetch remote changes.
3: Fetch remote changes
$ git remote update
Now, I delete the old branch(let's forget about the commits that I made it to July-09 branch for a moment) and create another private branch by following the steps mentioned above in step 2. It is fine but when I invoke git command to get the status of the working tree(say master, remember I've just issued 'git remote update'), it tells me that my branch and 'origin/master' have diverged. steps, as in 4:
4: Get the information on working tree status
$ git checkout master # switch back to master $ git remote update # Fetch remote updates Fetching origin remote: Counting objects: 29053, done. remote: Compressing objects: 100% (4329/4329), done. ....... .......
Quoted 1 line
From
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next
* [new tag] v3.11-rc3 -> v3.11-rc3
$ git branch -D July-09 # deleting the old branch $ git branch # Left with master now * master $ git checkout next-20130801 -b Aug-01 # Creating once again a new branch $ git branch * Aug-01 <--- Currently on Aug-01 master $ git status # On branch Aug-01 nothing to commit (working directory clean) $ git checkout master # Switch back to master once again $ git branch Aug-01 * master <--- Currently on master
$ git status # get the working tree status # On branch master # Your branch and 'origin/master' have diverged, <-------------------+ # and have 368 and 3227 different commit(s) each, respectively. <----+ # nothing to commit (working directory clean)
So, What should I do to keep my local master in sync with the remote origin/master ? Will a 'git pull' work ? Actually I tried 'git pull', but it gave me some warning messages, hence I interrupted(CTRL-c) this in between <snip>
$ git pull warning: too many files (created: 926 deleted: 310), skipping inexact rename detection warning: too many files (created: 4620 deleted: 3979), skipping inexact rename detection warning: too many files (created: 1256 deleted: 405), skipping inexact rename detection </snip>
!!amit
Quoted 2 lines · Kumar Amit Mehta
1. Clone the tree (once):
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
This won't do what you want. What you want is something more like:
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git $ git remote add linux-next git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git $ git fetch linux-next $ git fetch --tags linux-next
which will leave you a linux-next tree that you can update.
Quoted 1 line
$ git pull
This will *not* work on linux-next. Once you build the tree as above,
you want to use 'git remote update' instead of pull.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 865 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130801/1933c6c7/attachment.bin