πΎGit Notes
Still to document
- PRs (https://www.git-scm.com/docs/git-request-pull)
- Conflict resolution
- Squashing
- Options during an interactive rebase
Commands
Useful Resources
Git learning game: https://learngitbranching.js.org
Useful commands for fixing mistakes: https://ohshitgit.com
Connecting to GitHub
Logging in to GitHub on the command line: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
Use a personal access token instead of a password
View stored credentials (plain text)
vim ~/.git-credentials
Git Configuration Settings
View/edit git configuration settings
If there's nothing there already this will create a new file
vim ~/.gitconfig
Add this to the
[alias]
sectionPretty view of commit tree for current branch
[alias] tree = log --color --graph --pretty=format:'%Cred%h%Creset -%C(bold magenta)%d%Creset %s %C(cyan)(%cr)%C(bold blue) <%an> %Creset' --date=relative --abbrev-commit --all
[alias] tree-current = log --color --graph --pretty=format:'%Cred%h%Creset -%C(bold magenta)%d%Creset %s %C(cyan)(%cr)%C(bold blue) <%an> %Creset' --date=relative --abbrev-commit --all
Then run the commands
git tree
git tree-current
Last updated