-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Labels
Points: 20open-for-allAny one can work on it without getting assigned, every PR can mergeAny one can work on it without getting assigned, every PR can merge
Description
FOSS β Second Issue π
Git Commit Amend
Issue Type
FOSS Β· Beginner Β· Open for All π
Contribution Rules β
- Work only on foss branch
- Original content only (No AI usage, otherwise Straight PR Rejection)
Objective
To learn how git commit --amend can be used to change both commit content and commit message while keeping the commit count as one.
Steps To Solve
- Switch to foss branch
git checkout foss- Inside the task-02 folder, create a folder named with your GitHub Username.
Inside your folder, create a file named amend.txt with the following content:
Git practice.
- First commit (initial message)
git add amend.txt
git commit -m "Initial commit"πΈ Screenshot 1 required
Run:
git log --onelineTake a screenshot showing the initial commit message.
- Modify file content
Update amend.txt to:
Git amend practice.
- Amend the commit with a new message
git add amend.txt
git commit --amendChange the commit message to:
Updated amend.txt using commit amend
πΈ Screenshot 2 required:
Again run:
git log --onelineTake a screenshot showing the updated commit message.
Mandatory PR Requirements
- Exactly ONE commit in history
- Two screenshots:
- Before amend (old commit message)
- After amend (new commit message)
- Screenshots must clearly show git log --oneline
PR Submission Checklist β
- amend.txt exists
- Only one commit present
- Commit message changed using --amend
- Two screenshots attached in PR description
Answer the Following in Your Own Language (PR Description)
- Why does Git still show only one commit after using git commit --amend?
- What is the risk of using git commit --amend after pushing the commit?
Pull Request Rejection Criteria β
- Wrong branch
- More than one commit
- Missing any screenshot
- Same commit message in both screenshots
- Unauthorized changes
Metadata
Metadata
Assignees
Labels
Points: 20open-for-allAny one can work on it without getting assigned, every PR can mergeAny one can work on it without getting assigned, every PR can merge