Learn Selenium and Java for Selenium

Sunday, 10 June 2018

GIT in Practical World


GIT in Practical World

We have discussed about meaning of different GIT commands. Now biggest challenge is how exactly GIT is being used in our projects. What kind of GIT approaches are getting followed in organization?


Git approach 1-Using Fork
Let’s take scenario, there are three members in a team as A, B, C. Their project (Demo_GIT) is in central main repository. All three are working on same file ex. XYZ.java

Each team member will create fork of the central main repository. Forking is nothing but taking copy of the repository.

For example, ‘A’ will create fork as Demo_GIT_A.
Then they can take clone of fork into their local and they can start working on their assigned task.
After they done with their work.  They will commit it and take pull from Demo_GIT(main repository).

After resolving conflict, they will push their code to respective Fork.

Now they will raise Pull Request from fork Demo_GIT_A ->Demo_GIT. Here reviewer can review the changes. If everything is fine. Reviewer will merge the code.



Git approach 1-Using Branches

Let’s take same scenario as above, Demo_GIT project is on master branch, all team members will create individual branches.

For example, ‘A’ will create branch as Demo_GIT_A in the same repository.
Then they can take clone of branch into their local and they can start working on their assigned task.

After they done with their work. Its team member’s responsibility to keep their branch updated. So, they will commit it and will take updates from master branch to their individual branch(Demo_GIT->Demo_GIT_A). Now they will take Pull from Demo_GIT_A.
 After resolving conflict, they will push their code to respective Fork.

Now they will raise Pull Request from branch Demo_GIT_A ->Demo_GIT. Here reviewer can review the changes. If everything is fine. Reviewer will merge the code.








0 comments:

Post a Comment

Popular Posts

Recent Posts



Newsletter

Join our newsletter to get secret tips directly in your inbox!


*We Hate Spam!

Powered by Blogger.