From: Johannes Schindelin Date: Sat, 19 Jan 2008 22:50:01 GMT Subject: Re: Any command to simplify 'git fetch origin && git reset --hard origin/master'? Message-ID: In-Reply-To: <46dff0320801190603w4f0b2595v495ed10f2a87b0cc@mail.gmail.com> Hi, On Sat, 19 Jan 2008, Ping Yin wrote: > On Jan 19, 2008 7:15 PM, Johannes Schindelin 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. Hth, Dscho