**GitHub Commands Explained (Terminal-Based)**
**GitHub Commands Explained (Terminal-Based)** *(Note: Screenshots unavailable, but step-by-step descriptions provided)*
---
Related Images
**`git clone [repository_url]`**
- Clones a GitHub repository locally.
*Example:*
git clone https://github.com/username/repo.git*(Terminal shows "Cloning into 'repo'..." followed by file downloads.)*
**`git branch`**
- Lists local branches.
git branch*(Output: `* main` → Shows active branch.)*
**`git checkout [branch_name]`**
- Switches to a branch.
git checkout feature/add-login*(Terminal confirms: `Switched to branch 'feature/add-login'`)*
---
**`git add .`**
- Stages all modified files.
*(Terminal shows no output unless files change.)*
**`git commit -m "Message"`**
- Commits changes with a message.
git commit -m "Add user authentication"*(Terminal shows: `[detached HEAD 1234567] Add user authentication`)*
**`git push origin [branch_name]`**
- Pushes changes to a remote branch.
git push origin feature/add-login*(Terminal confirms: `Enumerating objects...` → Upload successful.)*
---
**`git pull origin [branch]`**
- Fetches and merges remote changes.
git pull origin main*(Terminal shows: `Updating 1234567..7654321` → Files updated.)*
---
**`git log`**
- Shows commit history.
git log --oneline*(Terminal output: compact list of commits with hashes.)*
**`git show [commit_hash]`**
- Displays detailed commit info.
git show 7654321*(Terminal shows diff and commit message.)*
---
**`hub issue create "Bug report"`**
- (Requires `hub` CLI) Creates a GitHub issue.
*(Terminal prompts for details → Issue created on GitHub.)*
**`hub pr create`**
- Creates a pull request from the current branch.
*(Terminal confirms: `Created pull request #123`)*
---
**`gh repo view`**
- (GitHub CLI) Shows details of a public repo.
gh repo view facebook/react*(Terminal displays repo stats, description, etc.)*
---
- **Permission denied**: Ensure SSH keys are added to GitHub.
- **Push rejected**: Confirm branch names match remote.
- **Conflict**: Use `git pull --rebase` to resolve locally.
---
**Summary**: Use these commands in your terminal (via Zed’s terminal) to interact with GitHub. For visual guidance, refer to GitHub’s [docs](https://docs.github.com) or tools like `git log --graph`.