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
- 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:
- First commit (initial message)
git add amend.txt
git commit -m "Initial commit"
πΈ Screenshot 1 required
Run:
Take a screenshot showing the initial commit message.
- Modify file content
Update amend.txt to:
- Amend the commit with a new message
git add amend.txt
git commit --amend
Change the commit message to:
Updated amend.txt using commit amend
πΈ Screenshot 2 required:
Again run:
Take 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
FOSS β Second Issue π
Git Commit Amend
Issue Type
FOSS Β· Beginner Β· Open for All π
Contribution Rules β
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
Inside your folder, create a file named amend.txt with the following content:
git add amend.txt git commit -m "Initial commit"πΈ Screenshot 1 required
Run:
Take a screenshot showing the initial commit message.
Update amend.txt to:
Change the commit message to:
πΈ Screenshot 2 required:
Again run:
Take a screenshot showing the updated commit message.
Mandatory PR Requirements
PR Submission Checklist β
Answer the Following in Your Own Language (PR Description)
Pull Request Rejection Criteria β