Re: [Banshee-List] coordinating new updates once a patch has been applied (newbie git question)



On Thu, Jun 18, 2009 at 11:05 PM, David Fox<dfox94085 gmail com> wrote:
>> You can 'git pull --rebase'. However, it's easier to just never change
>> the master branch. If you want to apply a patch, create a new local
>> branch and work on it.
>
> OK. That didn't work. I get errors :
>
> build/build.environment.mk: needs update
> configure.ac: needs update
> src/Extensions/Makefile.am: needs update
> refusing to pull with rebase: your working tree is not up-to-date
>
> Looks like I'll have to revert to the current master, and then follow
> your suggestion on cloning.

It sounds like you applied the patch and never committed it to your
local repository.  Git does not like moving around from commit to
commit when your working tree and/or the index contain changes.

If you still have the patch laying around, you can try this:

$ git reset --hard master  # Undo all changes to your working tree

$ git pull  # Update your local master from the remote repository

$ git checkout -b youtube-patch  # Create a new local branch

$ patch ...  # Apply your patch again

$ git add -u  # Add changed files to the index

$ git status  # Look at the status, use "git add" on any files that
are not going to be committed but should be (this should only be any
files added by the patch)

$ git commit  # Commit your changes to the new branch

Then, when there are changes on master you want applied to this
branch, you can just rebase it:

$ git checkout master  # Switch to the master branch

$ git pull  # Update it

$ git checkout youtube-patch  # Switch back to your branch

$ git rebase master  # Forward-port your commit on top of master

If there are any merge conflicts here you will have to fix them, then
"git add" the files to tell git that you resolved the conflicts, and
finally "git rebase --continue" to finish the rebase.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]