💾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

Connecting to GitHub

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] section

    • Pretty 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