Hi Curt,

git merge is your friend! Perhaps a complete example workflow will
help you get along:
suppose you are on branch "next" tracking the gitorious branch "next".
git branch wip       -- wip is now an exact copy of the next branch
git checkout wip
Edit files to add some really cool feature
git add [files to add] -- select which modified files you want to
commit to branch "wip"
git commit

Suppose you want to update your next branch, and incorporate those
changes in you "wip" branch:
git checkout next
git pull -- updates your branch "next". Should not produce any
merge-conflicts, since you didn't alter anything in your local branch
git checkout wip
git merge next -- merges changes in "next" into your "wip" branch
(in case of merge-conflicts, fix 'em)
git add [conflicted files] -- git's way of marking the conflicts resolved
git commit

Suppose you've got your "wip" branch in good shape, and up to date
(ie, you've just merged next into wip) and want to push to gitorious:
git checkout next
git merge wip -- should not produce merge-conflicts, since wip was
already up to date
git push

Then another useful feature of git: you can easily alter history.
(NOTE: you should only change history that is only your own repo.
Don't change the history which is already in more repos (pushed to
gitorious)
git commit --amend    -- "extends" the previous commit. Useful when
you're working in a branch, and need to make a temp commit to be able
to switch branches. You should also be able to use git stash in this
case, but I find this to be a lot less confusing than git stash

Hope this helps,
Stefan

2011/1/7 Curtis Olson <curtol...@gmail.com>:
> Hi Thorsten,
> Thanks for explaining this in detail.
> So here is my next question related to dealing with local branches.
> Let's say I make a local branch, make some changes, and I'm finally happy
> with those changes, so I commit them.  (Or maybe I've committed several
> revisions of my changes over the past few days and I'm finally happy with
> the current state of things.)
> Now I want to roll these changes in my local branch back into "next" and
> push them up to the upstream repository.  What is the procedure for doing
> that?
> And if in the mean time, other people have made changes and commited them
> and pushed them up to the "next" branch, how do I update my local branch to
> have all the latest changes that other people have made?
> Thanks,
> Curt.
>
> On Fri, Jan 7, 2011 at 1:00 PM, ThorstenB <bre...@gmail.com> wrote:
>>
>> On Fri, Jan 7, 2011 at 7:48 PM, Curtis Olson wrote:
>> > So what happens if I'm messing around with my
>> > "WildCrazyIdea-I-WantToTry"
>> > branch over lunch, and suddenly I get a phone call and have to jump back
>> > to
>> > doing something serious with FlightGear and need to quickly switch back
>> > to
>> > my "RealWork" branch.
>> > Do I have to commit my "CrazyIdea" branch changes --- no matter what
>> > intermediate state of weirdness they are in --- before I can switch back
>> > to
>> > the RealWork branch?
>> If you want git to take care of switching these files, then yes,
>> you'll need to commit them to some branch. I'm not familiar with this
>> stashing option. What I'd do is either commit the changes to the
>> current branch - or, in case the changes are just too experimental and
>> I really don't want to modify the current branch, I just create a new
>> branch "git checkout crazyidea". The new branch is identical to the
>> former current branch then. So I can just add&commit the experimental
>> changes to the new "crazyidea" branch and then switch back to the
>> former working branch - or to some other stable branch... And you can
>> always remove the "crazyidea" branch again - if the idea turns out not
>> to be so good after all, or you just wanted something temporary.
>>
>> cheers,
>> Thorsten
>>
>>
>> ------------------------------------------------------------------------------
>> Gaining the trust of online customers is vital for the success of any
>> company
>> that requires sensitive data to be transmitted over the Web.   Learn how
>> to
>> best implement a security strategy that keeps consumers' information
>> secure
>> and instills the confidence they need to proceed with transactions.
>> http://p.sf.net/sfu/oracle-sfdevnl
>> _______________________________________________
>> Flightgear-devel mailing list
>> Flightgear-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/flightgear-devel
>
>
>
> --
> Curtis Olson:
> http://www.atiak.com - http://aem.umn.edu/~uav/
> http://www.flightgear.org - http://www.flightgear.org/blogs/category/curt/
>
> ------------------------------------------------------------------------------
> Gaining the trust of online customers is vital for the success of any
> company
> that requires sensitive data to be transmitted over the Web.   Learn how to
> best implement a security strategy that keeps consumers' information secure
> and instills the confidence they need to proceed with transactions.
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> Flightgear-devel mailing list
> Flightgear-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/flightgear-devel
>
>

------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to