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

  • Add this to the [alias] section

    • Pretty view of commit tree for current branch

  • Then run the commands

Git Temp Patch

  • A great way to get all the changes from a branch and see them on another branch

1. Make sure you're on your feature branch

git checkout your-branch

2. Create a patch of all changes since main (as a diff)

git diff main > temp.patch

3. Checkout main and pull latest

git checkout main git pull origin main

4. Apply the patch (this makes the changes uncommitted on main)

git apply temp.patch

Last updated