Lesson 57 +15 XP

Sharing and Inspection Commands

These commands move commits between repositories and inspect the details of your history.

git remote

Code

bash
git remote -v
git remote add origin URL

Manage connections to remote repositories.

git fetch

Code

bash
git fetch

Downloads remote commits but does not merge them.

git pull

Code

bash
git pull

Fetches and merges remote commits.

git push

Code

bash
git push
git push -u origin main

Uploads local commits to the remote.

git clone

Code

bash
git clone URL

Copies a remote repository locally.

git show

Code

bash
git show
git show abc123

Inspects a single commit.

git blame

Code

bash
git blame file.txt

Shows who changed each line.

Debugging tools

Code

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.