Fig.1 - History of Commits in my Repository.
- Production (master)
- Integration
- HotFix
- feature1
- feature2
- First, I've set up the Github repository and cloned it locally and next, Main Branch, a branching off of HotFix and Integration Branch, was developed.
- Make feature1 and feature2 Branches from the Integration Branch. Add some changes and then adding 2 reviewers who made merging for the pull request to Integration.
- Change and commit in feature1 in Local Environment. However, we now seek to act before the merge that occurred in the origin/feature2 Therefore, we run the 'git pull —rebase' command to rebase. This implies that when we pull from the remote, our local commit will come first.
- Production(main) and HotFix branches now include changes from the Integration branch.
- Changes are developed on the HotFix branch and are integrated into the Integration and Production branch.
- feature1, feature2, and HotFix branches were ultimately deleted after completing the before mentioned processes.
- git clone - To clone the repository
- git log --online - To view the current logs graph for the repository
- git push - To push the local changes onto origin
- git pull - To pull changes from origin to local git pull
- git checkout - To navigate between the branches created by git branch git checkout
- git branch - To create or delete branches: git branch
- git checkout -d [branch name] - To delete a particular branch git checkout -d [branch name]
- git checkout -b [branch name] - To switch in a branch or create then switch to that branch if it doesn't exist git checkout -b [branch name]