[Top][All Lists]

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

Re: Pushing patches to staging

From: Phil Holmes
Subject: Re: Pushing patches to staging
Date: Sun, 13 Nov 2011 10:51:43 -0000

----- Original Message ----- From: "Carl Sorensen" <address@hidden> To: "Graham Percival" <address@hidden>; "David Kastrup" <address@hidden>
Cc: <address@hidden>
Sent: Saturday, November 12, 2011 11:59 PM
Subject: Re: Pushing patches to staging

On 11/12/11 3:08 PM, "Graham Percival" <address@hidden> wrote:

The only problem is to develop a series of simple commands to do
this task.

Here's my set of simple commands:

git checkout master
git pull origin master
git apply my_patch_file_name_goes_here
git checkout staging
git pull origin staging
git cherry-pick master
git push origin staging

These commands will work, unless some patch already applied to staging has
messed with the files in such a way that the cherry-pick fails.  When the
cherry-pick fails, I don't know of a way to do it without thinking.  At
that point, thought will be necessary.  Most often I will finish the
cherry-pick by doing

git mergetool

And solving the merge conflicts that show up, then committing the results
using the command that git gave me in the error message that said the
cherry-pick wouldn't apply.



Here's Carl's simple amended recipe, with my changes/comments. Can those that understand confirm this is OK?

git checkout master  # changes us to a local branch called master
git pull origin master # updates our local master branch from the source branch called origin git apply my_patch_file_name_goes_here # applies a downloaded patch. An alternative would be to edit the local files at this point git commit -a # commits the changes made by applying the patch/editing the files
git checkout staging # swap to local branch called staging
git pull origin staging # updates the local staging branch from the source branch called origin git cherry-pick master # I assume this updates my local staging branch with the new commit in my local master branch git push origin staging # This appears to push my local staging branch to the remote origin - not what we want?

I'm waving in the dark a bit here, but I am Graham's idiot and I want to change one line in the CG. Will this work:

git pull # updates my master branch, which is the only one I have, from remote
# edit my file
git commit -a
git push staging # I believe this pushes any commits I have to the remote branch called staging

Phil Holmes

reply via email to

[Prev in Thread] Current Thread [Next in Thread]