git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git ready: daily git tips
@ 2009-02-08 22:18 Nick Quaranto
  2009-02-08 22:24 ` Steven Noonan
  2009-02-09 20:42 ` Nicolas Pitre
  0 siblings, 2 replies; 5+ messages in thread
From: Nick Quaranto @ 2009-02-08 22:18 UTC (permalink / raw)
  To: git


I started this blog just around a month ago on a quest to learn more about
git on a daily basis and to show others how awesome it is. If you have any
suggestions on what content to cover or how things should be done
differently, I would greatly appreciate it. Thanks!

http://gitready.com
-- 
View this message in context: http://n2.nabble.com/git-ready%3A-daily-git-tips-tp2294642p2294642.html
Sent from the git mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git ready: daily git tips
  2009-02-08 22:18 git ready: daily git tips Nick Quaranto
@ 2009-02-08 22:24 ` Steven Noonan
  2009-02-09 20:42 ` Nicolas Pitre
  1 sibling, 0 replies; 5+ messages in thread
From: Steven Noonan @ 2009-02-08 22:24 UTC (permalink / raw)
  To: Nick Quaranto; +Cc: git

On Sun, Feb 8, 2009 at 2:18 PM, Nick Quaranto <nick@quaran.to> wrote:
>
> I started this blog just around a month ago on a quest to learn more about
> git on a daily basis and to show others how awesome it is. If you have any
> suggestions on what content to cover or how things should be done
> differently, I would greatly appreciate it. Thanks!
>
> http://gitready.com

Heh, I've already got this in my RSS reader. It's got some pretty
awesome tips. I've learned more about git on there than pretty much
any other resource.

Keep up the good work. :)

- Steven

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git ready: daily git tips
  2009-02-08 22:18 git ready: daily git tips Nick Quaranto
  2009-02-08 22:24 ` Steven Noonan
@ 2009-02-09 20:42 ` Nicolas Pitre
  2009-02-10  1:20   ` Sitaram Chamarty
  1 sibling, 1 reply; 5+ messages in thread
From: Nicolas Pitre @ 2009-02-09 20:42 UTC (permalink / raw)
  To: Nick Quaranto; +Cc: git

On Sun, 8 Feb 2009, Nick Quaranto wrote:

> 
> I started this blog just around a month ago on a quest to learn more about
> git on a daily basis and to show others how awesome it is. If you have any
> suggestions on what content to cover or how things should be done
> differently, I would greatly appreciate it. Thanks!
> 
> http://gitready.com

Well done.

One topic that IMHO you fail to cover, and which is being neglected 
almost everywhere else too, is the reflog.

The reflog is really your safety net when working with git.  It records 
everything you do. So even if you screw up a rebase, perform the wrong 
merge, or any other kind of undesired operation, then you may always go 
back to a previous state.  Either you use -g with 'git log' to see all 
those recorded states, or even 'git reflog' without any argument to get 
a condensed list for HEAD.

The <branch>@{<spec>} notation can be used anywhere a ref is normally 
required.  The special branch "HEAD" shows every state the HEAD pointer 
went through, including branch switches.  The <branch< part can be left 
out to mean "currently checked-out branch".

One thing that I use all the time after a 'git pull' is 'git log @{1}..' 
where "@{1}" means the first previous tip of the current branch, so 
effectively showing me the log of what the pull brought in my branch.


Nicolas

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git ready: daily git tips
  2009-02-09 20:42 ` Nicolas Pitre
@ 2009-02-10  1:20   ` Sitaram Chamarty
  2009-02-10 10:19     ` Johannes Schindelin
  0 siblings, 1 reply; 5+ messages in thread
From: Sitaram Chamarty @ 2009-02-10  1:20 UTC (permalink / raw)
  To: git

On 2009-02-09, Nicolas Pitre <nico@cam.org> wrote:
> On Sun, 8 Feb 2009, Nick Quaranto wrote:
>> http://gitready.com
>
> Well done.
>
> One topic that IMHO you fail to cover, and which is being neglected 
> almost everywhere else too, is the reflog.
>
> The reflog is really your safety net when working with git.  It records 
> everything you do. So even if you screw up a rebase, perform the wrong 
> merge, or any other kind of undesired operation, then you may always go 
> back to a previous state.  Either you use -g with 'git log' to see all 
> those recorded states, or even 'git reflog' without any argument to get 
> a condensed list for HEAD.
>
> The <branch>@{<spec>} notation can be used anywhere a ref is normally 
> required.  The special branch "HEAD" shows every state the HEAD pointer 
> went through, including branch switches.  The <branch< part can be left 
> out to mean "currently checked-out branch".
>
> One thing that I use all the time after a 'git pull' is 'git log @{1}..' 
> where "@{1}" means the first previous tip of the current branch, so 
> effectively showing me the log of what the pull brought in my branch.

Also, the @{now} notation to get a relative timestamp of the
reflog is invaluable.  Seeing reflog lines annotated with
'14 minutes ago' or '17 hours ago' or perhaps '4 days ago',
really helps to focus on the commits you're looking for:

    git reflog show @{now}
    # (the 'show' is not optional in this syntax)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git ready: daily git tips
  2009-02-10  1:20   ` Sitaram Chamarty
@ 2009-02-10 10:19     ` Johannes Schindelin
  0 siblings, 0 replies; 5+ messages in thread
From: Johannes Schindelin @ 2009-02-10 10:19 UTC (permalink / raw)
  To: Sitaram Chamarty; +Cc: git

Hi,

On Tue, 10 Feb 2009, Sitaram Chamarty wrote:

> On 2009-02-09, Nicolas Pitre <nico@cam.org> wrote:
> > On Sun, 8 Feb 2009, Nick Quaranto wrote:
> >> http://gitready.com
> >
> > Well done.
> >
> > One topic that IMHO you fail to cover, and which is being neglected 
> > almost everywhere else too, is the reflog.
> >
> > The reflog is really your safety net when working with git.  It records 
> > everything you do. So even if you screw up a rebase, perform the wrong 
> > merge, or any other kind of undesired operation, then you may always go 
> > back to a previous state.  Either you use -g with 'git log' to see all 
> > those recorded states, or even 'git reflog' without any argument to get 
> > a condensed list for HEAD.
> >
> > The <branch>@{<spec>} notation can be used anywhere a ref is normally 
> > required.  The special branch "HEAD" shows every state the HEAD pointer 
> > went through, including branch switches.  The <branch< part can be left 
> > out to mean "currently checked-out branch".
> >
> > One thing that I use all the time after a 'git pull' is 'git log @{1}..' 
> > where "@{1}" means the first previous tip of the current branch, so 
> > effectively showing me the log of what the pull brought in my branch.
> 
> Also, the @{now} notation to get a relative timestamp of the
> reflog is invaluable.  Seeing reflog lines annotated with
> '14 minutes ago' or '17 hours ago' or perhaps '4 days ago',
> really helps to focus on the commits you're looking for:
> 
>     git reflog show @{now}
>     # (the 'show' is not optional in this syntax)

Yes, I often use "git log -g --date=relative" to get a better 
understanding of my recent actions in that particular repository.

Also do not forget to advertise the new @{-<n>} notation for the n-th last 
branch you were on (to be part of 1.6.2 AFAIU).  This comes in really 
handy when you juggle a dozen branches (and happen to commit to the wrong 
branch ;-)

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-02-10 10:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-08 22:18 git ready: daily git tips Nick Quaranto
2009-02-08 22:24 ` Steven Noonan
2009-02-09 20:42 ` Nicolas Pitre
2009-02-10  1:20   ` Sitaram Chamarty
2009-02-10 10:19     ` Johannes Schindelin

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).