Git Branching Process
Here is the process we are using in homepage to keep track of the issues/tickets done on a particular day.
Create Branch
- Go to github, tw-pages-client repo.
- Create a branch named "datemonthyear". For example: if today's date is Aug,11,2021 then branch name will be "11082021".
Checking out branch
There are two ways of how we can take branch in our system to work on it:
Taking Clone
To clone the branch entirely into different project, run the following command:
git clone -b branchName git@github.com:AntaresSystems/tw-pages-client.git
Checking out branch in same project
To checkout branch in the same cloned project run the following commands:
git checkout branchName
To check which branch are you on:
git branch
Committing and pushing to branch
- Before committing we have to take pull from both branches.
git pull
git pull origin master
- Check if you are no right branch
git branch
- Add the files
git add
- Commit the files
git commit -m Commit Message
- Push the Files
git push
Creating Merge Request
At the end of the day when all commits have been done to the new branch, We have to create pull/merge request from new branch to the master branch. Follow the given steps to do so:
- Go to go github repo.
- Switch to the new branch.
- Go to Pull Requests.
- Click on New Pull Request and create a request to merge.