From: Bryan Donlan <bdonlan@gmail.com>
To: John Dlugosz <JDlugosz@tradestation.com>
Cc: Junio C Hamano <gitster@pobox.com>,
Jakub Narebski <jnareb@gmail.com>,
git@vger.kernel.org
Subject: Re: fetch and pull
Date: Sat, 7 Mar 2009 03:00:56 -0500 [thread overview]
Message-ID: <3e8340490903070000t2780764cocfbf28d538037df5@mail.gmail.com> (raw)
In-Reply-To: <450196A1AAAE4B42A00A8B27A59278E70A115F5D@EXCHANGE.trad.tradestation.com>
On Fri, Mar 6, 2009 at 5:11 PM, John Dlugosz <JDlugosz@tradestation.com> wrote:
> ===Re:===
>> There was patch series adding support --ff=only, but I think it didn't
>> made into git... Hmmm...
>
> I do not think it has much to do with the main point of what John wants
> to
> do which is to muck with local branch without checking it out, which is
> only possible when it happens to fast forward to the new tip of the
> corresponding branch obtained from the the remote.
> ===end===
>
> It occurs to me that maybe my concept is off, if it is being so
> difficult.
>
> Here is what I'm "cooking":
>
> ======excerpt======
>
> To keep apprised of other people's work, including updates to the main
> dev branch, start the day with:
>
> git fetch
>
> This will update your "remote tracking branches", letting you see what
> everyone else is working on, and letting you see the central
> repository's dev (as remotes/origin/dev) compared to your own local dev,
> so you can see what has been added.
>
> This does not change your local dev, or any other branches you are
> using. As for your own topic branches, you are the only one who changes
> them. This is a perfectly safe command and can be performed any time to
> update your view of what's happening throughout the team.
> You will, in particular, see your local dev where you last left it, and
> the current remotes/origin/dev pointing ahead of it. E.g.
>
> A <== dev
> \
> B--C--D <== remotes/origin/dev
>
> In this example, you see plain "dev" still pointing to A, and
> "remotes/origin/dev" pointing to D. So, you can tell that B, C, D were
> added. Review the nodes B, C, and D, by reading the comments and seeing
> which files were affected, and look deeper if it seems to affect what
> you are doing. Finally, issue the command
>
> ???
>
> And this will update your local dev to match the origin.
>
> ======
>
> Basically, instead of mysterious "can't push" messages, the idea is that
> people can feel good about 'fetch' as refreshing their view of the
> central repo, so gitk can show them how the central dev (and other
> branches) differs from their own.
If the local "dev" is a topic branch, you'd want to either merge or
rebase with the origin's dev branch. Rebasing is probably best if
you've not published the branch yet (unless you'd prefer proper merge
history on it).
If the local "dev" is meant to just track the remote, you really ought
to avoid doing anything very involved in it (unless you're planning on
merging something into it and pushing the result, that is!). If
there's no local changes, then you can just pull with impunity, and
let it fast-forward - or use git merge or git rebase if you've already
fetched and don't want to spend the few seconds it takes to ask the
server if there's anything new :)
Finally, if you really, truly, definitely want to blow away the
current branch and replace it with another one, you can use git reset
--hard. This will throw away (irretrievably) local uncommitted
changes, and force the current branch to point to the specified one.
Remember, you can undo most things using the reflog if you mess up,
including unwanted merges, git reset --hard (committed changes only)
etc.
next prev parent reply other threads:[~2009-03-07 8:05 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-06 19:04 fetch and pull John Dlugosz
2009-03-06 19:27 ` Junio C Hamano
2009-03-06 20:44 ` Jakub Narebski
2009-03-06 20:49 ` Junio C Hamano
2009-03-06 22:11 ` John Dlugosz
2009-03-06 22:21 ` Junio C Hamano
2009-03-07 8:00 ` Bryan Donlan [this message]
2009-03-07 20:15 ` Junio C Hamano
2009-03-09 15:27 ` John Dlugosz
2009-03-09 15:08 ` John Dlugosz
[not found] <AcmmaYOKDtJohyDSQt2B3xvVeIPNPw==>
2009-03-16 19:00 ` John Dlugosz
2009-03-16 20:03 ` Jay Soffian
2009-03-16 20:39 ` John Dlugosz
2009-03-16 20:43 ` Sverre Rabbelier
2009-03-17 8:34 ` Jeff King
2009-03-17 8:36 ` Sverre Rabbelier
2009-03-16 22:14 ` Jay Soffian
2009-03-16 22:33 ` John Dlugosz
2009-03-17 0:09 ` Jay Soffian
2009-03-17 14:58 ` John Dlugosz
2009-03-17 16:21 ` Jay Soffian
2009-03-17 16:44 ` John Dlugosz
2009-03-17 21:31 ` Nanako Shiraishi
2009-03-18 8:58 ` Björn Steinbrink
2009-03-18 9:37 ` Junio C Hamano
2009-03-18 15:18 ` John Dlugosz
2009-03-18 15:31 ` Björn Steinbrink
2009-03-18 16:50 ` John Dlugosz
2009-03-18 0:37 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3e8340490903070000t2780764cocfbf28d538037df5@mail.gmail.com \
--to=bdonlan@gmail.com \
--cc=JDlugosz@tradestation.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jnareb@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).