git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ping Yin" <pkufranky@gmail.com>
To: "Junio C Hamano" <gitster@pobox.com>
Cc: "Git Mailing List" <git@vger.kernel.org>
Subject: Re: Any command to simplify 'git fetch origin && git reset --hard origin/master'?
Date: Sat, 19 Jan 2008 16:08:55 +0800	[thread overview]
Message-ID: <46dff0320801190008p4489b7a2g6153ba7d30f942c3@mail.gmail.com> (raw)
In-Reply-To: <7vbq7i9r48.fsf@gitster.siamese.dyndns.org>

On Jan 19, 2008 4:06 PM, Junio C Hamano <gitster@pobox.com> wrote:
>
> "Ping Yin" <pkufranky@gmail.com> writes:
>
> > On Jan 19, 2008 3:06 PM, Junio C Hamano <gitster@pobox.com> wrote:
> >> "Ping Yin" <pkufranky@gmail.com> writes:
> >>
> >> > I often encounter the case that the origin reposotory is rebased and i
> >> > make sure i want to use the origin head as my master
> >> > Now I have to do
> >> > $ git fetch origin && git reset --hard origin/master
> >>
> >> The fact you are resetting means you do not have anything
> >> interesting in your own branch yourself (--hard will lose your
> >> changes and you are willing to lose it), which makes the use
> >> case much less interesting, but I can understand a workflow that
> >> is based around rebases, as in:
> >>
> >>         $ git fetch origin && git rebase origin/master
> >>
> > I know 'git pull --rebase' and use it frequently. However, in the case
> > i mentioned above, i never do any change in this local branch, i just
> > use this branch for deployment which should always keep the same with
> > the origin head (just like the remote tracking branch). So i need a
> > 'fetch & reset --hard' equivalent, not the 'fetch & rebase'
> > equivalent.
>
> Unless I am misreading you, you did not read what I wrote.
>
> If you do not have any change on that branch, "git rebase
> origin/master" will be equivalent to "git reset --hard
> origin/master".
>
But my case is that the origin head has been rewound.



-- 
Ping Yin

  reply	other threads:[~2008-01-19  8:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-19  5:22 Any command to simplify 'git fetch origin && git reset --hard origin/master'? Ping Yin
2008-01-19  6:04 ` David Symonds
2008-01-19  7:06 ` Junio C Hamano
2008-01-19  8:03   ` Ping Yin
2008-01-19  8:06     ` Junio C Hamano
2008-01-19  8:08       ` Ping Yin [this message]
2008-01-19 11:15 ` Johannes Schindelin
2008-01-19 14:03   ` Ping Yin
2008-01-19 22:50     ` Johannes Schindelin
2008-01-20  8:51       ` Ping Yin

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=46dff0320801190008p4489b7a2g6153ba7d30f942c3@mail.gmail.com \
    --to=pkufranky@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).