My Authors
Read all threads
Hello, class. I'm Mr. @Quinnypig, and I'll be your substitute teacher.

Today we're going to learn about git.
`git init` creates a .git/ subdirectory. `cd` into it, and `ls`.

See all of the files and folders there? What they do is arcane, but important. We don't want to lose track of them, so be sure to run `git init` so we can track them with git.
Ever start typing "git..." and then get confused, then paste the answer from Stack Overflow, then get "git not a valid git subcommand"?

Me too!

Create git-git containing "git $@" in your bin folder.

Now "git git FOO" works.

So does:
"git git git git git git FOO"
Naming conventions aren’t enforced rules, but they are important. That’s why you want to have your upstream called “master” and your primary branch called “origin”.
Do you forget the nuances of git subcommands?

Install github.com/nvbn/thefuck and the correct command is always "fuck".
Need to manage a bunch of git repos all at once? myrepos.branchable.com is your friend.
You can squash all of your previous messy commits into one commit using "git rebase." It works like this:

rm -rf .git
git init
git commit -am "Initial commit"
`git config --global alias.shame blame` means you can invoke "git blame" with "git shame" since that's how you're going to use it anyway.
Oh snap, `git blame` says it was you?! No worries; this is git. There's a tool to fix that, and it's called "git blame someone else"

github.com/jayphelps/git-…
Git config lives in three different places, for different purposes:

~/.gitconfig to set things for your user
.git/config to set things for a single repository
/etc/gitconfig to absolutely stomp a mudhole in your coworker's day as they go mad trying to figure out what's broken.
git fetch + git merge = git pull
git branch + git checkout = git checkout -b
Remember, you can always consult the git documentation at git-man-page-generator.lokaltog.net.
Git isn't designed to store sensitive details; that's what open S3 buckets are for.

Should you mess up and push a committed credential, you can either fix it with git filter-branch, or toss your computer into the sea and take up an agrarian lifestyle. Both are equally hard.
Remember, git is a decentralized system. That's why everything that even thinks about our code lives on GitHub and absolutely nowhere else.
Aliases can save a lot of typing.

To wit:

alias yolo='git commit -am 'DEAL WITH IT' && git push origin master --force'
Another useful alias"
alias git ="git $@ --force"
"Blameless post-mortems" are all well and good when 'git blame' is sufficient, but by the time they have to break out git-bisect, they'll be coming for your head.
Another useful alias:

alias ohfuckyou = 'git --set-upstream origin $(git rev-parse --abbrev-ref HEAD)'
“git stash” was created to even out the number of sub commands for a table once. That was the last time anyone paid attention to it.
“git p4” allows interoperability with Perforce because @jpaulreed is both incredibly stubborn and incredibly whiny.
This concludes our class today. Enjoy spending the rest of your day throwing up.
Missing some Tweet in this thread? You can try to force a refresh.

Enjoying this thread?

Keep Current with HydroxyCoreyQuinn

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!