On 04/18/2012 01:24 AM, Arvid Brodin wrote:
On 2012-03-31 08:50, Srivatsa Bhat wrote:
Hi,
On Sat, Mar 31, 2012 at 3:40 AM, Arvid Brodin <arvid.brodin@enea.com <mailto:arvid.brodin@enea.com>> wrote:
Arvid Brodin wrote: > On 2012-03-06, I cloned linux-next: > > $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git <http://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git> linux-next-20120306 > > > I now want to update this repository before posting patches, to make sure > they still apply cleanly. I first tried this on 20120328:
Tracking linux-next is a little bit different from usual trees. In particular, since Stephen Rothwell rebases it quite frequently, you shouldn't do a git pull on linux-next.
See these articles for details on how to work with linux-next: http://linux.f-seidel.de/linux-next/pmwiki/pmwiki.php?n=Linux-next.FAQ http://lists.kernelnewbies.org/pipermail/kernelnewbies/2012-February/004498....
Great links, thanks!
The first time I did 'git remote update' as described in the first link things worked fine: I could "git merge origin/master" to be up to date with origin/master (or perhaps I did a 'git rebase origin/master, I can't quite remember).
I tried the same thing ('git remote update; git merge origin/master') today, and got lots of CONFLICTs. So I tried to get master back and after some time ended up running 'git reset --hard; git clean -f -d', which I believe succeeded.
At this time 'git status' says the same as it did just after the remote update above:
# On branch master # Your branch and 'origin/master' have diverged, # and have 569 and 3251 different commit(s) each, respectively.
Ok, so let's try a 'git rebase origin/master' instead:
$ git rebase origin/master First, rewinding head to replay your work on top of it... Applying: fsnotify: inline mark refcnt functions Using index info to reconstruct a base tree... Falling back to patching base and 3-way merge... Auto-merging fs/notify/mark.c CONFLICT (content): Merge conflict in fs/notify/mark.c Auto-merging include/linux/fsnotify_backend.h Failed to merge in the changes. Patch failed at 0001 fsnotify: inline mark refcnt functions
When you have resolved this problem run "git rebase --continue". If you would prefer to skip this patch, instead run "git rebase --skip". To restore the original branch and stop rebasing run "git rebase --abort".
Huh?! I haven't touched that file! I just want to keep my linux-next tree up to date! How hard should this be?!
/calming down/
Any ideas on what I've done wrong and how to solve it?
I don't see why you should have run git merge origin/master etc.. Simply track linux-next like this: Initial setup: 1. Add linux-next as a remote tracking branch to your existing kernel git tree: git remote add linux-next git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 2. Fetch it, along with the tags: git fetch linux-next git fetch --tags linux-next Regular usage/tracking: 1. Update your linux-next: git checkout master //to be on the safer side git remote update 2. See what tags are available: git tag -l next-* Sample output: next-20120113 next-20120118 next-20120201 3. Pick the linux-next version you want to work on and create a local branch to do your changes: git checkout -b my_branch next-20120201 Then you can start working on 'my_branch'. Regards, Srivatsa S. Bhat