How do you connect to GitHub using SSH keys?
Generate an Ed25519 SSH key, add the public key to GitHub, test with ssh -T and switch your remotes to SSH URLs.
43 posts about Git: questions with answers, tutorials and articles, newest first.
Generate an Ed25519 SSH key, add the public key to GitHub, test with ssh -T and switch your remotes to SSH URLs.
Link a local branch to a remote branch once with git push -u or --set-upstream-to, so push, pull and status work without arguments.
git fetch downloads remote changes without touching your work, while git pull fetches and then merges or rebases into your branch.
Use git push to upload your local commits to a remote on GitHub, set the upstream once, and fix rejected pushes without losing work.
Use git clone to copy a remote repository with all its history, choose HTTPS or SSH, pick a folder name, and use shallow or single-branch options for speed.
Link an existing local Git project to a new GitHub repository with git remote add and git push -u, set up SSH or a token, and fix common push errors.
A remote repository is a shared copy of your project on another machine. See how git remote names it, what origin means and how remote-tracking branches work.
Work with a stack of stashes: list them, inspect with show, apply or pop a specific entry, drop or clear them, and recover a stash you dropped by mistake.
Park half-finished changes with git stash push, switch branches safely, and bring the work back with pop or apply, including untracked files and conflicts.
A detached HEAD means HEAD points at a commit, not a branch. See how it happens, why commits made there can be lost, and how to keep or discard them.
Run git merge --abort while a merge is unfinished. For a committed merge, use reset to ORIG_HEAD or revert -m 1 once the branch is pushed.
Git stops a merge when two branches edit the same lines. Read the conflict markers, choose the right text, stage the file and commit to finish.
A fast-forward only moves a pointer, a three-way merge creates a merge commit. See when each happens and how to control it with --no-ff and --ff-only.
package-lock.json pins every installed package to an exact version. Learn what it contains, why you commit it and how npm ci relies on it.
Switch to the receiving branch and run git merge. See what fast-forward and merge commits look like, and which options control the history.
Rename a local branch with git branch -m and delete it with -d or -D. Learn the safe workflow and how to update the remote copy too.
HEAD is Git's marker for the commit you are working on. See how it moves when you commit, switch branches and reset, and what detached HEAD means.
Create a branch and move onto it with git switch -c, change branches with git switch, and see how the old git checkout commands map to them.
A Git branch is a lightweight pointer to a commit that isolates your work. Learn what it is, why teams use branches and a simple workflow.
git clean deletes untracked files and cannot be undone. Learn the dry run, the -f, -d, -x and -i options and a safe routine.