Skip to content

update commands - #5

Merged
sammad00 merged 1 commit into
mainfrom
staging
Jul 15, 2026
Merged

update commands#5
sammad00 merged 1 commit into
mainfrom
staging

Conversation

@sammad00

@sammad00 sammad00 commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Documentation
    • Expanded the Git practice guide with detailed, numbered tutorials covering repository setup, file management, staging, commits, history, branching, and remote workflows.
    • Added commonly used Linux commands and a complete end-to-end Git workflow example.
    • Added a consolidated checklist of Git commands covered.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

commands.md was rewritten as a comprehensive Git practice guide with numbered command tutorials, branching and remote workflows, Linux command references, complete workflow examples, and a consolidated command checklist.

Changes

Git Practice Guide

Layer / File(s) Summary
Expanded Git practice documentation
commands.md
The guide adds detailed sections for repository setup, file operations, staging, commits, history, branching, remote repositories, Linux commands, complete workflows, and covered-command checklists.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is related to the change, but it is too generic to clearly describe the rewritten Git practice guide. Rename it to something more specific, such as 'Expand Git practice commands guide'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch staging

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@commands.md`:
- Around line 279-297: Remove the unmatched trailing Markdown code fence after
the “Git Commands Covered” command list; keep the preceding workflow fence
closure intact so the remainder of the document renders normally.
- Around line 35-39: Reorder the file lifecycle examples in commands.md so
nibbi.txt is created and staged before demonstrating git rm --cached and git
restore, or clearly mark the sections as independent exercises. Update the
related “Remove Files” and later Git command sections to ensure following them
sequentially does not attempt to add or restore a file that was already deleted.
- Around line 52-53: Replace the hard-coded identity commands in the Git
configuration instructions with generic name and email placeholders, and scope
configuration to the current repository rather than using the global option.
Apply the same change to both referenced command occurrences.
- Around line 162-181: Add a remote setup subsection before the “16. Pull Latest
Changes” commands, including git remote add origin <repository-url>, so the
origin remote exists before any git pull or git push command uses it.
- Around line 232-264: Update the git initialization sequence by adding git
branch -M main immediately after git init, before any checkout commands, so the
later checkout main succeeds regardless of Git’s default initial branch name.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2347a999-f459-4d59-8849-b88298ff3d7a

📥 Commits

Reviewing files that changed from the base of the PR and between 5647ab7 and 0c0a0a9.

📒 Files selected for processing (1)
  • commands.md

Comment thread commands.md
Comment on lines +35 to 39
## 3. Remove Files
```bash
rm -f helo.txt
rm nibbi.txt
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Make the file lifecycle consistent with the later Git commands.

nibbi.txt is deleted before git init and before it is staged, so the later git add nibbi.txt, git rm --cached nibbi.txt, and git restore nibbi.txt examples fail when followed in order. Move the deletion/restore exercise after staging or explicitly mark each section as independent.

Also applies to: 65-86

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@commands.md` around lines 35 - 39, Reorder the file lifecycle examples in
commands.md so nibbi.txt is created and staged before demonstrating git rm
--cached and git restore, or clearly mark the sections as independent exercises.
Update the related “Remove Files” and later Git command sections to ensure
following them sequentially does not attempt to add or restore a file that was
already deleted.

Comment thread commands.md
Comment on lines +52 to +53
git config --global user.name "sammad00"
git config --global user.email "[email protected]"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Do not hard-code a personal identity or modify users’ global Git configuration.

These commands expose [email protected] and make readers’ commits use the author’s identity across every repository. Use placeholders and repository-local configuration instead:

Suggested change
-git config --global user.name "sammad00"
-git config --global user.email "[email protected]"
+git config user.name "Your Name"
+git config user.email "[email protected]"

Also applies to: 234-235

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@commands.md` around lines 52 - 53, Replace the hard-coded identity commands
in the Git configuration instructions with generic name and email placeholders,
and scope configuration to the current repository rather than using the global
option. Apply the same change to both referenced command occurrences.

Comment thread commands.md
Comment on lines +162 to +181
# Remote Repository

## 16. Pull Latest Changes
```bash
git pull origin main

git pull origin staging
```

---

## 17. Push Changes
```bash
git push origin dev

git push origin main

git push origin staging

git push -u origin staging

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== files matching commands.md =="
git ls-files | rg '(^|/)commands\.md$|(^|/)COMMANDS\.md$|(^|/)commands\.MD$' || true

echo
echo "== search for remote add origin in repo =="
rg -n --hidden --glob '!**/.git/**' 'git remote add origin|remote add origin|origin <repository-url>|git pull origin|git push origin' .

echo
echo "== commands.md around lines 140-190 =="
sed -n '140,190p' commands.md

echo
echo "== commands.md around lines 250-280 =="
sed -n '250,280p' commands.md

Repository: sammad00/git_for_devops

Length of output: 1214


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== file tree for top-level markdown files =="
git ls-files '*.md' | sed -n '1,120p'

echo
echo "== locate any mention of remote setup in commands.md =="
rg -n 'remote|origin|pull|push' commands.md

Repository: sammad00/git_for_devops

Length of output: 609


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== commands.md around lines 140-190 =="
sed -n '140,190p' commands.md

echo
echo "== commands.md around lines 250-280 =="
sed -n '250,280p' commands.md

echo
echo "== repo-wide search for origin remote setup and origin-based git commands =="
rg -n --hidden --glob '!**/.git/**' 'git remote add origin|remote add origin|git pull origin|git push origin' .

Repository: sammad00/git_for_devops

Length of output: 1202


Add an origin remote before the first push/pull

commands.md:162-181, 266-270 uses git pull origin ... and git push origin ..., but there’s no git remote add origin ... anywhere in the document. Add the remote setup before these commands:

git remote add origin <repository-url>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@commands.md` around lines 162 - 181, Add a remote setup subsection before the
“16. Pull Latest Changes” commands, including git remote add origin
<repository-url>, so the origin remote exists before any git pull or git push
command uses it.

Comment thread commands.md
Comment on lines 232 to +264
git init

git config --global user.name "sammad00"
git config --global user.email "[email protected]"

touch nibba.txt
touch nibbi.txt

git add nibba.txt
git add nibbi.txt

git commit -m "adding nibba and nibbi"
git commit -m "Initial commit"

git checkout -b dev

touch niboo.txt
git add niboo.txt
git commit -m "added niboo"
git commit -m "Added niboo"

git checkout master
git checkout -b feature

vim branching.md
git add branching.md
git commit -m "Added branching documentation"

git checkout dev
git merge feature

git checkout -b staging
git merge dev

git checkout main
git merge dev

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Show the relevant section with line numbers
sed -n '210,280p' commands.md

# Look for any earlier mention of main/default-branch creation in this file
rg -n "\b(main|branch -M|init.defaultBranch|checkout main|checkout -b main)\b" commands.md

Repository: sammad00/git_for_devops

Length of output: 1169


🏁 Script executed:

#!/bin/bash
set -euo pipefail

sed -n '210,280p' commands.md
printf '\n---\n'
rg -n "\b(main|branch -M|init.defaultBranch|checkout main|checkout -b main)\b" commands.md

Repository: sammad00/git_for_devops

Length of output: 1174


Create main before the first checkout. A plain git init may leave the repo on master (or another default), so the later git checkout main can fail. Add git branch -M main immediately after init.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@commands.md` around lines 232 - 264, Update the git initialization sequence
by adding git branch -M main immediately after git init, before any checkout
commands, so the later checkout main succeeds regardless of Git’s default
initial branch name.

Comment thread commands.md
Comment on lines +279 to +297
# Git Commands Covered

- git init
- git config
- git status
- git add
- git rm --cached
- git restore
- git commit
- git log
- git log --oneline
- git branch
- git checkout
- git checkout -b
- git merge
- git push
- git push -u
- git pull
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Remove the unmatched code fence.

Line 297 opens a fenced block after the command list without a language or closing fence, which can cause the remainder of the Markdown document to render as code. Delete it; the preceding workflow fence is already closed.

🧰 Tools
🪛 markdownlint-cli2 (0.23.0)

[warning] 297-297: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@commands.md` around lines 279 - 297, Remove the unmatched trailing Markdown
code fence after the “Git Commands Covered” command list; keep the preceding
workflow fence closure intact so the remainder of the document renders normally.

Source: Linters/SAST tools

@sammad00
sammad00 merged commit a496854 into main Jul 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant