This repository is a hands-on Git learning activity designed for 2 participants to practice real-world Git collaboration concepts such as branching, merging, conflicts, pull requests, and git stash.
- Person A → Developer
- Person B → Team Lead / Repository Owner
- Repository name:
fintech-app - Default branch:
main - Both users have:
- Git installed
- GitHub / GitLab accounts
By completing this activity, learners will understand:
- Repository collaboration
- Clone, pull, and push workflow
- Feature branches
- Merge conflicts and resolution
- Pull Request (PR) flow
- Using
git stashfor urgent interruptions
mkdir fintech-app
cd fintech-app
echo "FinTech App - Initial Version" > README.md
echo "console.log('Hello FinTech');" > app.js
git init
git add .
git commit -m "Initial local project setup"Create a repository named fintech-app on GitHub/GitLab.
git remote add origin https://github.com/b/fintech-app.git
git branch -M main
git push -u origin maingit clone https://github.com/b/fintech-app.git
cd fintech-appecho "// Added by B" >> app.js
git add app.js
git commit -m "B added comment"
git pushgit pullgit checkout -b feature-login
echo "Login feature by A" > feature-login.txt
git add .
git commit -m "Added login feature"
git push -u origin feature-logingit checkout main
git pull
git merge origin/feature-login
git pushA edits and pushes:
sed -i '2s/.*/Line 2 updated by A/' README.md
git add README.md
git commit -m "A updated README"
git pushB edits without pulling:
sed -i '2s/.*/Line 2 updated by B/' README.md
git add README.md
git commit -m "B updated README"
git pullEdit file to:
Line 2 updated by A and B
Then:
git add README.md
git commit -m "Resolved merge conflict"
git pushgit checkout -b bug-fix
echo "// Bug fixed by A" >> app.js
git add app.js
git commit -m "Bug fix"
git push -u origin bug-fixCreate PR from bug-fix → main and merge after review.
echo "Feature work by A" >> app.js
echo "Temp notes" > temp.txt
git stash
git stash listgit checkout -b hotfix-payment
echo "// Hotfix applied" >> app.js
git add app.js
git commit -m "Payment hotfix"
git push -u origin hotfix-paymentgit checkout main
git pull
git stash popgit clone
git pull
git push
git checkout -b
git merge
git stash
git stash popThis project is for educational and training purposes only.