Git's incredible velocity and iron-clad backwards compatibility are a paradox: how does a CLI tool introduce hundreds of new features without changing its existing behavior? With command-line options, of course! The downside is that Git now has literally thousands of options littering its man pages. The only way to master them is through the ancient art of aliasing. This talk covers the nuts and bolts of creating Git aliases and automating Git-related JIRA and Bitbucket interactions from the command line. Attendees will learn tips and tricks for speeding up their workflow, improving their CLI mastery, and they'll also learn a lot about Git in the process.
Tim Pettersen, Senior Developer Advocate, Atlassian
4. GIT STASH
$ echo “work work work work work work” >> work.txt
$ git stash
$ git status
$ git stash pop
Saved working directory and index state WIP …
nothing to commit, working tree clean
Changes to be committed:
modified: work.txt
5. GIT STASH
$ echo “new stuff” > new.txt
🤔No local changes to save
$ git stash
$ git status
Untracked files:
new.txt
7. GIT STASH
$ echo “new stuff” > new.txt
🤔--include-untracked
No local changes to save
$ git stash
$ git status
Saved working directory and index state WIP …
Untracked files:
new.txt
nothing to commit, working tree clean
14. GIT STANDUP
$ git standup
Fix format of `git standup` command
Document which and lucky
Document the pipelines alias
wrap at 80 chars
Add git serve alias
Use vanilla ! format for standup alias
19. GIT NGROK
$ git ngrok
[31074] Ready to rumble
Serving your repo at: git://0.tcp.ngrok.io:17720/
Press any key to tear down...
$ git clone git://0.tcp.ngrok.io:17720/ my-repo
Cloning into ‘my-repo'...
Waiting for git daemon and ngrok to start...
24. Context and namespacing
WHEN SHOULD I ALIAS?
Git aliases are for Git operations.
Bash aliases run anywhere.
If it doesn’t use a Git command (or touch .git/)
it probably shouldn’t be a Git alias.