Source Control
Last updated
Last updated
During the creation of a piece of software, source code control is used to monitor changes made to source code and other text files. By doing so, the user is able to access any earlier versions of the original source code as well as any saved changes. Also, the developers check the quality of the code with reviewing and testing it.
For source control in our case, Github is used. There are several steps for managing and reviewing the code:
Navigate to the main page of the repository.
Above the list of files, click Branches.
Click New branch.
Type a name for the branch.
Choose a source for your branch. Select the branch dropdown menu and click a branch.
Click Create branch.
After this make a commit to the server. A commit saves changes to one or more files in your branch, just like saving a modified file. Each commit in Git is given a special ID that indicates:
The particular changes
When were the modifications made?
Who was the author?
When you make a commit, you must include a commit message that briefly describes the changes.
Navigate to the main page of the repository and click pull requests.
Click new pull request.
To choose the branch into which you want to merge your modifications, use the base branch dropdown menu.
Type a title and description for your pull request.
To create a pull request that is ready for review, click Create Pull Request.
The review is done from another developer. He can also comment the changes with the author. And the author must improve his code before he merges with the main branch.
Sometimes, the pull request of a task is not completed after the reviewing part. Then, one developer comments the change that must be done. The other developer makes another commit to the branch with the improved code. Finally, the code is approved from the reviewer, and it can be merged with the main branch.
After the review is done, the author of the pull request can merge the code with the main branch.