Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario - Know About GitHub Reviewer

Introduction

 
In my previous article, we discussed the steps of owner added files using git bash in the main branch in-depth and how to clone the uploaded project of GitHub repo for testing purposes. In this real-time series of articles, we discuss steps to push, pull and clone repository files to GitHub by team members using Git Bash under Organization. Here one member will add reviewers to review its pushed files by creating a pull request. In one scenario, the reviewer finds the issue or unwanted files and information to the user by adding comments on that particular pull request. After solving these issues by the user, the user again pushes the changes, creates a pull request for the latest changes, and then it will be merged to the main branch.
 
Today, I will describe the below-mentioned points in detail,
  1. satyaCsgithub member will identify account using author identity
  2. satyaCsgithub member will clone the GitHub project and create a new branch
  3. satyaCsgithub member will open and modify the GitHub project
  4. satyaCsgithub member will add, commit and push the changes to the GitHub repo
  5. satyaCsgithub member will create a pull request for the latest changes
  6. The owner will review these changes and ask satyaCsgithub member to fix the issue
  7. satyaCsgithub member will fix the issue and follow the above steps (1 to 5) in sequence
  8. The owner again will review these changes
  9. Finally, the branch of satyaCsgithub member will merge to the main branch for production deployment
  10. The owner will pull the changes in local git from GitHub repo as made by satyaCsgithub member
Note
Before going through this session, please visit my below-mentioned sessions related to Git and GitHub,
  1. Introduction To Git
  2. Steps For Configuring Git With Details
  3. Let's Know About Git Add, Git Commit, Git Status, And Git Push-In Details
  4. Let's Understand How Git Maintains History Of Version Or Commit Ids With Details
  5. Steps To Initialize A Git Repository And Push The Changes To GitHub In Details
  6. Let's Know About Git Branches And How To Implement It
  7. Let's Understand About Git Branches And Its Real-Time Uses
  8. Let's Learn About Merging The Git Branches And Create Pull Request In Details
  9. Steps To Ignore Files Using Gitignore In Details
  10. Let's Learn About Git Default Branch In Detail
  11. Steps To Create And Configure Organizations In GitHub In Details
  12. Let's Learn About GitHub Projects In Detail
  13. Let's Know About Team In GitHub In Details
  14. Managing Files On GitHub In Real-Time - Owner Uploads Project In GitHub Repo

Identify account using author identity

 
Here we login as a satyaCsgithub member and can see the repo with the .NET health care project as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Here the satyaCsgithub member will create a local directory and mention his User Email and User Name of GitHub account for author identity using Git Bash as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario

satyaCsgithub will clone the GitHub project and create a new branch

 
Now clone the project from a repo in the local git as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
Here we change the directory to GitHub repo folder and check the default branch associated with the GitHub repo in local as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Next, create a new branch for satyaCsgithub member called satyaCsgithub_BranchRepo in the local git repository and make satyaCsgithub_BranchRepo as a current working branch or active branch instead of the main branch in my local git repository as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 

satyaCsgithub member will open and modify the GitHub project

 
Now open the solution (.sln) using visual studio as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Now we can see the local Git repo and the default branch as created earlier as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Then run the project to check the output as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Now open the index.html and modify the header content of the web application from Welcome to Satya Org Global Health Care to Welcome to Satya Org Global Health Care 2021 and check the output as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
The output is shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Now we check the status of these changes using Git Bash and Visual Studio as shown below,
 
Using Visual Studio the file index.html is shown as a red tick mark as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Now we check the history section where the project is modified by which GitHub users as shown below. As of now we can see the changes in the GitHub repo made by the owner called Infosatya with commit ID and commit message as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Now we can compare the changes of index.html as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Now, we change the directory to WebApplication1 of the GitHub repo folder as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Check the status using Git Bash and we can see the modified file name index.html as shown below. Here we can see other files which are auto-generated while building the solution. So, we need to ignore these files.
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Here the existing file called index.html changes is not committed to the staging area and we can see the list of files under this local repo path as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 

satyaCsgithub member will add, commit and push the changes

 
Here the member adds the changes of index.html to the staging area as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
If I check the status then see the result as already ready to be committed to the staging area and not committed files are shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Then commit those changes to the staging area using the command as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Then push those files from local git to GitHub repository using the command as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Now, we can see the update in the View History section after pushing the changes using Visual Studio as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
After successfully pushing these changes to the GitHub repo my new branch called satyaCsgithub_BranchRepo will be shown with the modified file in the GitHub repo as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario 
 
Here we can see the new branch created by members in the GitHub repo as shown in the branch list.
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
After selection of branch, we can see the changes with commit message as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
The commit changes of index.html file as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
But in the same file if we check under the selection of the main branch then these changes are not available as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 

satyaCsgithub member will create a pull request for the latest changes

 
Click the Pull Request option as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Then create a pull request with details as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Here you get an interface as shown below after creating the pull request.
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
In pull request, we can check if the before changes and after changes of index.html need to be merged under the Files changed option.
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Under the Commits section, we can check the user name who commits with added comments as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Here the member will add the Reviewers to review the changes under this pull request as shown below. Here we can request up to 15 reviewers. So, here the member added the owner as of the Reviewer.
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
After adding the Reviewer the interface will be shown as below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
InfoSatya was requested for review as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Here the owner called InfoSatya will get a mail that @satyaCsgithub requested your review on #1 Year added in header section as shown below. Here #1 is a link navigate to the pull request URL created by satyaCsgithub member i.e. https://github.com/SatyaOrgGlobal/HealthCare-Proj/pull/1
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 

The owner will review these changes and ask satyaCsgithub member to fix the issue

 
Here the owner InfoSatya will login to his GitHub account and review the changes of satyaCsgithub using the pull request URL as described earlier.
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Then the Reviewer will check the index.html file and its changes under the Files changed section.
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
After adding the review by Reviewer the interface is shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Here we check the comments added by the Reviewer to make changes in the index.html file as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Here we can see the changes are requested as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 

satyaCsgithub member will check the comment of the Reviewer and fix the issue

 
Here the satyaCsgithub member will get the mail about the changes requested by the Reviewer as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
Now the member called satyaCsgithub will login and check the changes requested by the Reviewer as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Here, I will make changes in the index.html file in the header section as per changes requested by the owner as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario 
 
Now check the status as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario 
 
Here the member added the changes of index.html to the staging area as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario 
 
If I check the status then see the result as already ready to be committed to the staging area and not committed files are shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario 
 
Then commit those changes to the staging area using the command as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario 
 
Then push those files from local git to GitHub repository using the command as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario 
 
Now, we can see the update in the View History section after pushing the changes using Visual Studio as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario 
 
Now check the GitHub repo as shown for the latest changes as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Now check the index.html file changes made in GitHub repo as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Now check our existing pull request for these new changes as shown below. Click on Compare link.
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
So, we check the code status with commit changes as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Now we check the pull request URL to check the updated commit status as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario 
 
Now add the Reviewer again as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 

The owner again will review these changes 

 
Now the owner will check mail as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Now the owner will login and check the pull request to review the changes under the Files changed section as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Then owner adds the comment as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Now check the interface with reviewed status as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 

Branch of satyaCsgithub member will merge to the main branch for production deployment

 
Now the owner will Merge the pull request as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Then confirm merge with comments added for merging the pull request as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Now merged with the main branch successfully as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
The interface will be shown with merged status as shown below. We can delete the branch after the pull request is successfully merged and closed.
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Now go to the main branch and check the index.html with the latest changes after successfully merged as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Now check the index.html file with the latest commit message in the main branch for production deployment as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Now satyaCsgithub members will login and check the pull request or PR request as shown below. Here members will get mail about successfully merged pull requests.
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Now check the merged PR status as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Now check the pull request URL as shown below. It shows merged status.
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
In this way, we can manage files in GitHub, and at the same time, the user will get the mail for his operation performed. Here the owner will get the updated status about files to change made by other GitHub members in the mail. In this way, the member gets the status in the GitHub account and in the mail simultaneously. After successfully merged in the main branch, the file is ready for production deployment.
 

The owner will pull the changes in local git from the GitHub repo

 
Now owner will pull the latest changes in local git as shown below. First, the owner will be identified using Author Identity.
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Now the owner will open the solution using Visual Studio and check the index.html under the main branch as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 
Now the owner can see the latest changes of index.html under the main branch. Here owner will check the history of commit ID and message as per the latest changes made in GitHub repo by GitHub repo members as shown below,
 
Managing Files On GitHub Using Git Bash 📥📤 In Real-Time Scenario
 

Summary

 
In this write-up, we have learned the below details,
  • satyaCsgithub member will identify account using author identity
  • satyaCsgithub member will clone the GitHub project and create a new branch
  • satyaCsgithub member will open and modify the GitHub project
  • satyaCsgithub member will add, commit and push the changes to the GitHub repo
  • satyaCsgithub member will create a pull request for the latest changes
  • The owner will review these changes and ask satyaCsgithub member to fix the issue
  • satyaCsgithub member will fix the issue and follow the above steps (1 to 5) in sequence
  • The owner again will review these changes
  • Finally, the branch of satyaCsgithub member will merge to the main branch for production deployment
  • The owner will pull the changes in local git from GitHub repo as made by satyaCsgithub member
Thank You & Stay Tuned For More