

Git and GitHub Secrets [video] - dpearson
http://confreaks.com/videos/1229-aloharuby2012-git-and-github-secrets

======
prolepunk
The the talk goes on about GitHub and then Git, so the title could be
structured a little better; I don't use github as much as I use git, so here's
the link to the second part of the talk --
[http://www.youtube.com/watch?feature=player_detailpage&v...](http://www.youtube.com/watch?feature=player_detailpage&v=Foz9yvMkvlA#t=1570s)

There's quite of few intricate git parameters I didn't know about, so here's
my notes for almost all of them:

    
    
       git add -p [ a logical way of staging hunks ( diff entities) ]
       git checkout - [ '$ cd -' for branches ]
       git branch --merge [ show all merged branches ]
       git branch --no-merge [ not merged branches ]
       git branch --contains [ which branch contains a particular sha ]
       git checkout BRANCH -- path/to/file [ copy a file from a different branch ]
       git log branchA ^branchB [ show commits in a that not in b]
       git fsck --lost-found [ show deleted content that hasn't been gc'd]
       git diff HEAD --stat [ force display commit message ]
       git blame -w [ shows who changed each line while ignoring whitespace changes ]
       git blame -M [ ignore move commits, display only code changes ]
       git blame -C/-CC/-CCC [ ignore different levels of move/rename and only display code block creation or modification commits ]
       git config remotes.mygroup 'remote1 remote2' [ group multiple remotes ]
       git status -sb [ colorize status, remove fluff ]
       git diff HEAD^ --word-diff [ colorize and highlight word changes instead of producing line diffs ]
       git config --global help.autocorrect 1 [ convert 'did you mean' messages into action, questionable usefulness ]
       git config --global rerere.enabled 1 [ remember previously merged commits when merging repeatedly with same branches, i.e. master -> long running dev branch ]
       git config --global color.ui 1 [ command that I keep googling on stack overflow whenever I setup git on a new machine ]
       git commit --amend [ modify commits that haven't been pushed to remote ]
       git reset --soft HEAD^ [ retains commit diff as 'staged' as opposed to complete erase with --hard ]
       git shortlog -sn [ count number of line diffs by author? committer? ]
       git commit (--amend) --author "Author Name <author@email>" [ attribute commit ]
    

A minor nitpick about the talk, is that the speaker tries to humor everyone
and most of the time it falls flat, I mean calling everyone who can setup SSH
keypair neckbeards? It's a little more cringeworthy than funny, and thanks to
moments like this the attitude of the presenter comes off as a bit
presumptuous.

~~~
mercurial
I haven't watched the talk, but I'd like to highlight a couple of commands you
mention.

"git add -p" is absolutely phenomenal. I'm probably not the only one keeping
on working on something until it functions, which often means solving several
issues at the same time. This command lets you add file chunks in the commit
staging area, instead of entire files, up to the point where you can actually
edit the patch itself. As useful as it is dangerous (it's a good way of
committing invalid code).

"git commit --amend" - this works only on the last commit of the current
branch, and it doesn't care whether your commit has been published or not. You
might care, though, once you attempt to push your amended commit and it
complains the remote can't be fast-forwarded. Extremely useful though (how
many times have you forgotten to add a new file to your VCS before commit?)

I'm surprised not to see "git reflog" in the list of commands listed. Git
being something of a wonderful footgun, this is a command every git user
should know. It essentially records the commits you have made. Feeling bad
about your last "git branch -D"? Your rebase didn't turn out so well? You need
"git reflog".

I'll toss in "git whatchanged" as well. This is "git log" but with the list of
files modified.

~~~
prolepunk
About 'git commit --amend' actually it works on any commit that hasn't been
pushed upstream, the speaker talks about for some time, so the more verbose
version of the command would be 'git commit --amend <SHA Hash>' but all of the
previous commits are usually pushed upstream anyway, so effectively this
command works only on the last commit.

I didn't know about reflog and whatchanged, I'll definitely read up on them.
Thanks!

~~~
mercurial
Clearly not with every git:

    
    
      $ git commit --amend a98fd2e95dde78041132b6281f6c2127712507f5
      error: pathspec 'a98fd2e95dde78041132b6281f6c2127712507f5' did not match any file(s) known to git.
      $ git --version
      git version 1.7.11.msysgit.1

------
AdamGibbins
<http://zachholman.com/talk/git-github-secrets>

------
btian
this is probably unrelated but can anyone explain why the size of the 1080p
video is so much larger than the 720p one? (1920x1080) / (1280x720) = 2.25
while 1.6 x 1024 / 237.3 = 6.9

~~~
hoka
probably bitrate?

------
hayksaakian
Is this link bait or actually worth reading?

