Skip to content

Latest commit

 

History

History
64 lines (56 loc) · 1.64 KB

File metadata and controls

64 lines (56 loc) · 1.64 KB

Advanced Git Practice

Assignment Overview :

The objective of this assignment was to get familiar with Git Flow for structured branching and to practice advanced Git operations such as Squash, Reset, Rebase, and Cherry-Pick.

Commands Used

Initialize Repository and Git Flow

git clone <repository-url>
cd <repository-name>
git init
git flow init

Create Feature Branch

git flow feature start TP2-T1299_Project_Setup

Create Sub-Branch

git checkout -b TP2-T1299_Project_Setup_SubBranch

Perform Git Operations

Squash Commit:
Combine multiple commits into one for a cleaner history.

git rebase -i HEAD~<number_of_commits>

Reset:
Undo changes either by keeping them staged (--soft) or discarding completely (--hard).

git reset --soft HEAD~1
git reset --hard HEAD~1

Rebase:
Update your branch with the latest changes from develop.

git checkout TP2-T1299_Project_Setup_SubBranch
git rebase develop

Cherry-Pick a Commit:
Apply a specific commit from another branch.

git cherry-pick <commit-hash>

Push Branches to GitHub

git checkout develop
git push -u origin develop

git checkout TP2-T1299_Project_Setup
git push -u origin TP2-T1299_Project_Setup

git checkout TP2-T1299_Project_Setup_SubBranch
git push -u origin TP2-T1299_Project_Setup_SubBranch

Pull Request and Merge

1 : Create a PR from TP2-T1299_Project_Setup_SubBranch to TP2-T1299_Project_Setup.
2 : Merge the PR after review.
3 : Create a PR from TP2-T1299_Project_Setup to develop.
4 : Merge the PR after review.