Loading lessons...
Sharing and Inspection Commands
These commands move commits between repositories and inspect the details of your history.
git remote
bash
git remote -v
git remote add origin URL
Manage connections to remote repositories.
git fetch
bash
git fetch
Downloads remote commits but does not merge them.
git pull
bash
git pull
Fetches and merges remote commits.
git push
bash
git push
git push -u origin main
Uploads local commits to the remote.
git clone
bash
git clone URL
Copies a remote repository locally.
git show
bash
git show
git show abc123
Inspects a single commit.
git blame
bash
git blame file.txt
Shows who changed each line.
Debugging tools
bash
git grep "search term"
git bisect start
grep searches your files and history; bisect hunts down which commit introduced a bug.
TL;DR
- remote, fetch, pull, push, and clone share work.
- show and blame inspect commits and lines.
- grep searches content; bisect finds the commit that broke something.