Squash Merge
Duration: .. minutes
Based on:
1. Set-Up
1.1 Open PowerShell window
1.2 Restore state from backup copy
Copy the code, right-click in PowerShell window to paste it and press Enter to execute
cd ~/Documents/git-workoutsCopy-Item bak-2.3 current -Recurse -Forcecd current2. Make first commit
2.1 Switch into branch
Type in PowerShell prompt and press Enter to execute
git switch categories2.2 Create file
Type in PowerShell prompt and press Enter to execute
New-Item categories.md2.3 Stage changes
Type in PowerShell prompt and press Enter to execute
git add -A2.4 Commit changes
Type in PowerShell prompt and press Enter to execute
git commit -m "Add categories.md"3. Make second commit
3.1 Add content into the file
Type in PowerShell prompt and press Enter to execute
Set-Content -Path "categories.md" -Value "# Categories"3.2 Stage changes
Type in PowerShell prompt and press Enter to execute
git add -A3.3 Commit changes
Type in PowerShell prompt and press Enter to execute
git commit -m "Add title into categories.md"3.4 View commit history
Type in PowerShell prompt and press Enter to execute
git log --oneline
4. Merge changes into master
4.1 Switch into master branch
Type in PowerShell prompt and press Enter to execute
git switch master4.2 Merge changes
Type in PowerShell prompt and press Enter to execute
git merge categories --squash
4.3 Commit changes
Type in PowerShell prompt and press Enter to execute
git commit -m "Create categories.md and add title into it"4.4 View commit history
Type in PowerShell prompt and press Enter to execute
git log --oneline --graph
4.5 Delete categories branch
Type in PowerShell prompt and press Enter to execute
git branch -d categories
4.6 Force delete categories branch
Type in PowerShell prompt and press Enter to execute
git branch -D categories5. Wrap-Up
5.1 Make backup copy
Copy the code, right-click in PowerShell window to paste it and press Enter to execute
cd ..Copy-Item current bak-2.4 -Recurse -ForceRemove-Item current -Recurse -Force