Yujin Kim,
PhD
The aim of this task is to show my skill in software version control for a teamwork. Part of the JavaScript code that I wrote in Section - Earth Engine was used as an example.
Git and GitHub – Software Versioning
Aim
Approach and Methodology
I undertook this task by myself, but I presented it from the perspective of someone working on a team to demonstrate my skill in software versioning. The scenario for the task had the following elements:
-
Three people were working together: master (=user-01), user-02 and user-03.
-
Three GitHub [1] accounts were created for the following users:
- Master: https://github.com/git-and-github-user
- User-02: https://github.com/git-user-02
- User-03: https://github.com/git-user-03
-
Command Prompt (cmd) via Visual Studio Code [2] and GitHub Desktop [3] were used while having Git Bash [4] on a local machine.
Process
A repository (repo) for an image classification task was initialised using cmd in Visual Studio. The first branch, ‘nCluster_10.js (SHA-1 hash [hereinafter hash] = 27332c5)’, was created. It was on the branch master and the HEAD was pointing to it (Fig. 1.1).

Fig. 1.1. Initiate the first repository.
The first repo was published to the master’s GitHub account (Fig. 1.2).

Fig. 1.2. The first repo on the master’s GitHub.

One branch is shown in the GitHub (Fig. 1.3).
Fig. 1.3. The first branch in the GitHub.
The master allowed users-02 and -03 to access the repo (Fig. 1.4).

Fig. 1.4. Users-02 and -03 have access to master’s repo.
User-02 cloned the first branch created by the master to user-02’s local computer (Fig. 1.5).

Fig. 1.5. The first branch was cloned to user-02’s local machine.
User-02 added a new branch named ‘secondBranch’ and created an additional code ‘nClusters_50.js’ (Fig. 1.6).

Fig. 1.6. User-02 added the second branch with the additional code.
User-02 sent a pull request to the master regarding the changes (Fig. 1.7).

Fig. 1.7. The pull request sent by user-02 to the master.
The master has received user-02’s pull request (Fig. 1.8) and has merged the changes (Fig. 1.9).


Fig. 1.8. The master’s GitHub account showing the user-02’s pull request.

Fig. 1.9. The master merged the changes made by user-02.
Only one branch is shown in the master’s GitHub repo after merged (Fig. 1.10).

Fig. 1.10. One branch is shown after merged.
User-03 cloned the merged repo from the master’s GitHub to user-03’s local machine (Fig. 1.11). The status showed that a current branch was master’s, and the log displayed the history – the first file was created (hash = 27332c5), the second file was on the second branch (c44dae3), and the merged request was pulled by user-02 (a94d5c0).

Fig. 1.11. Cloned repo by user-03.


The third branch named ‘thirdBranch’ was created, and the head was switched to the thirdBranch (Fig. 1.12). A new file, nCluster_200.js, was added and committed.
Fig. 1.12. The third branch was created, and nCluster_200.js was added/committed.
User-03 published the updated repo to GitHub using GitHub Desktop, and two branches (master and thirdBranch) were shown (Fig. 1.13).

Fig. 1.13. Updated repo in user-03’s GitHub account.
User-03 sent a pull request to the master (Fig. 1.14).

Fig. 1.14. Pull request by user-03.
The master accepted the pull request from user-03, and the updated file was merged (Fig. 1.15).

Fig. 1.15. The updates from user-03 were merged into the master’s repo.
References
[1] GitHub,
https://github.com/.
[2] Visual Studio Code,
https://visualstudio.microsoft.com/.
[3] GitHub Desktop,
https://desktop.github.com/.
[4] Git Bash,
https://git-scm.com/.