From: "Ping Yin" <pkufranky@gmail.com>
To: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>
Cc: "Git Mailing List" <git@vger.kernel.org>
Subject: Re: Any command to simplify 'git fetch origin && git reset --hard origin/master'?
Date: Sun, 20 Jan 2008 16:51:19 +0800 [thread overview]
Message-ID: <46dff0320801200051p4dd21930u5712a72baaf9af78@mail.gmail.com> (raw)
In-Reply-To: <alpine.LSU.1.00.0801192247280.5731@racer.site>
On Jan 20, 2008 6:50 AM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> Hi,
>
> On Sat, 19 Jan 2008, Ping Yin wrote:
>
> > On Jan 19, 2008 7:15 PM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> >
> > > On Sat, 19 Jan 2008, Ping Yin wrote:
> > >
> > > > 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
> > >
> > > Just make an alias if you're too lazy to type.
> > >
> > > Personally, I do not see much sense in it, and it is too dangerous to
> > > bless it with an option to fetch or pull.
> >
> > Can any alias do this? Since a parameter 'origin' or something should be
> > passed in.
>
> Yes. Something like
>
> $ git config alias.imtoolazytotype \
> '!sh -c "git fetch $0 && git reset --hard $0/master"'
>
> See http://git.or.cz/gitwiki/Aliases for more, especially the part about
> advanced aliases with arguments.
>
wonderful!
> Hth,
> Dscho
>
>
--
Ping Yin
prev parent reply other threads:[~2008-01-20 8:51 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
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 [this message]
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=46dff0320801200051p4dd21930u5712a72baaf9af78@mail.gmail.com \
--to=pkufranky@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
/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).