Version Control (Part1-Part.11) [Git] articles are available on Amazon kindle Unlimited (e-book).
howahowablog.com will only be able to read Part.5/10/11.
Version Control (Parts 12-21) [GitHub (Part 1)] articles are available on Amazon kindle Unlimited (e-book).
Only part15/19 will be available on howahowablog.com.
Version Control (Part 21-Part.30) [GitHub (Part 2)] articles are available on Amazon kindle Unlimited (e-book).
Only Part.24/30 will be available on howahowablog.com.
Objectives of Chapter 9
Check and perform the development process using Git and GitHub.
Team development flow using Git and GitHub
Confirm the team development process using Git and GitHub
As in the previous chapter, we will review the series of tasks performed in team development.
※This chapter covers 7, 8, and 9.
- Move items in “Projects”.
- Create a “feature branch” in the local repository, edit the file and commit it.
- Merge the “feature branch” into the “develop branch”.
- Create a “release branch” and make additional edits if necessary.
- Merge the “release branch” into the “develop branch” and the “main branch”.
- Push the latest status (the local side) and submit a “pull request”.
- Approve the pull request. (Reviewer side)
- Merge the “develop branch” into the “main branch” in the remote repository.
- “fetch” + “merge” a remote repository into a local repository.
Approve the pull request
In Chapter 9, the pull requests created in the previous chapter are approved. In practice, the code and the person doing the merging work are checked before approval. The instructions here assume that everything has been done.
Click on the “Pull requests” tab under “howahowaSite”.
Click on the one you want to review from the list of pull requests.
In this case, it is a development relating to “Feat: Projects ‘A-001’.” Click on.
It takes you to the pull request details page.
Click on the selection button for the merge type and select “Create a merge commit”.
Click on “Merge pull request”.
When the display changes to the following, click “Confirm merge”.
Click on “Confirm merge” and the display changes to “Merged” to complete the merge.
Merge the “develop branch” into the “main branch” in GitHub
Continue by approving the pull request and merging the “develop branch” with the updated content into the “main branch”.
Click on the “Pull requests” tab on GitHub.
On the page that appears, click “New pull request”.
The “Compare changes” page appears. On the “Compare changes” page, select the merge target and the merge source.
Select “main” for the “base” side and “develop” for the “compare” side.
After making your selection, click on “Create pull request”.
The screen changes to the “Open a pull request” screen.
In the title, enter “Version 1.00”. In the body, enter “This is a merge as version 1.00.”.
When merging into the “main branch” in this way, enter the version information. After entering the information, click “Create pull request”.
The “pull request” completes and the screen changes. (Captured below)
Scroll through the screen and select the type of merge. In this case, the merge is between Main branches, but in this book, “Squash and merge” is selected.
※Merge methods vary according to the rules of the team and are not uniformly applied.
After selecting the merging method, click on the button.
The display changes as follows. Click “Confirm squash and merge” without making any changes.
The display switches to “Merged” and the merge is complete.
This completes the merging process in the remote repository.
“fetch” + “merge” a remote repository into a local repository.
Move your work to the local side: open Visual Studio Code and launch Git Bush. In Git Bush, fetch the “develop branch” by entering the following command
Type “git fetch origin develop” to fetch the “develop branch” from the remote repository into the “remote tracking branch” in the local repository.
Then switch to the “develop branch” in the local repository and merge the contents of the “remote tracking branch”.
Type “git checkout develop” to switch the local repository branch to the “develop branch”.
Type “git merge origin/develop” to merge the “remote tracking branch”(‘remotes/origin/develop’) into the “develop branch”.
This time the merge has been completed using FAST FORWARD (fast forward merge).
Pull a remote repository to a local repository
This time, instead of a “fetch” + “merge” operation, a “pull” operation is used to merge the main branch of the remote repository into the main branch of the local repository.
git checkout main … Switch the branch in the local repository to the “main branch”.
git pull origin main … The main branch of the remote repository is imported into the remote tracking branch of the local repository and further merged into the main branch of the local repository.
The merge is now complete. If you open index.html of the ‘main branch’ in a browser, you will see the completed display and behaviors. This concludes the creation of the sample site using Git and GitHub.
That’s all for this article.
This book, together with the series “Do not think hard Git & GitHub vol.1” and “Do not think hard Git & GitHub vol.2”, is now complete.
ブックマークのすすめ
「ほわほわぶろぐ」を常に検索するのが面倒だという方はブックマークをお勧めします。ブックマークの設定は別記事にて掲載しています。