Hello, class. I'm Mr. @Quinnypig, and I'll be your substitute teacher.
Today we're going to learn about git.
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.
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"
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 https://github.com/nvbn/thefuck and the correct command is always "fuck".
Install https://github.com/nvbn/thefuck and the correct command is always "fuck".
Need to manage a bunch of git repos all at once? https://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"
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" https://github.com/jayphelps/git-blame-someone-else
We would also accept "what sound does the release train makes""
https://twitter.com/quinnypig/status/1262773731962675201?s=21 https://twitter.com/quinnypig/status/1262773731962675201
https://twitter.com/quinnypig/status/1262773731962675201?s=21 https://twitter.com/quinnypig/status/1262773731962675201
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.
~/.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.