Ctrl K
Git
8 notes on git.
8 results
Discard Local Changes and Switch Branch
Steps to discard all tracked and untracked local changes, then switch to another branch.
Git Branches, Log, and Merge
View commit history, manage local and remote branches, pull new branches, and merge into main.
Git Init and First Push
Initialize a local repo, set the main branch, connect to a remote, and push for the first time.
Git Pull with Rebase
Fix a divergent main branch when the remote main changed and the local main also has an unpushed commit.
Git Workflow for Local Mirror Repositories
A fully local Git workflow using a bare .git directory as the central remote, with no dependency on any external hosting.
GitHub SSH Authentication for Local and EC2
Set up GitHub SSH authentication without repeated username and token prompts, using separate keys for local development and EC2.
GitHub SSH over Port 443
Fix 'ssh: connect to github.com port 22: Connection timed out' on networks that block port 22 by routing Git SSH through ssh.github.com on port 443.
Undo the Last Commit and Keep the Changes
Use git reset --mixed HEAD~1 to remove the last commit while keeping its changes in the working tree, ready to fix and re-commit.