Azure DEVOPS GIT Master and Origin/Master

davism
davism used Ask the Experts™
on
Hi,

Can anybody explain to me the difference between the Master and Origin/Master?

From what I understand the Master is the a local branch but if you do a pull request and all there is that not going into the Master?

Why is it necessary to approve the pull request and all on the Azure DevOps site using a browser? Why are not all the aspect contained and functional is Visual Studio 2019? Or is it?

Everything I have read or seen shows a browser for with Azure DEV ops and nothing explains the difference between the Master and Origin/Master. Which is use when? When I create a feature branch which Master do I create that off of?

Any info on this to help with clarity would be greatly appreciated.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Chinmay PatelChief Technology Ninja
Distinguished Expert 2018

Commented:
Hi Davism,

Origin\Master refers to the repo that you cloned from. Master refers to your local Repo. Another suggestion, If you are using Git in Azure DevOps,

When you do a Pull, remote version of the tracked files are copied to local versions.

I am not sure about what do you mean by using the browser for approving pull requests. Please elaborate.

If you are a developer and working in a team you will get the latest code from Origin/Master (At the start of the day) which will overwrite Master (Your Local files). And if everything goes fine, you will push some changes back to Origin\Master (could be end of the day, could be in 15 minutes or could be after a week).

To answer your branching query, I suggest you take a look at this blog: https://nvie.com/posts/a-successful-git-branching-model/ and come back with your doubts, that way you get clear idea of Branching (Azure DevOps or GitHub or BitBucket.. and so on) - Core concepts of Git are same. Maybe your system administrator has configured it differently.

Regards,
Chinmay,

Author

Commented:
Hi Chinmay,

So when you clone it creates the Master and the remote/Origin is the true source of truth? So, when you do a PUSH it comes from the remote/Origin and when you do a PULL request it updates the remote/Origin?

If that is the case and one does daily PUSH request it comes from the remote/Origin (i.e. Azure DevOps) then what is the purpose of the Master (i.e. Local Master)?

I am going to look at your link as well but please let me know if my questions make any sense there.
Chinmay PatelChief Technology Ninja
Distinguished Expert 2018

Commented:
Push updates Remote from Local and Pull updates Local from Remote.
11/26 Forrester Webinar: Savings for Enterprise

How can your organization benefit from savings just by replacing your legacy backup solutions with Acronis' #CyberProtection? Join Forrester's Joe Branca and Ryan Davis from Acronis live as they explain how you can too.

Author

Commented:
In looking, the link it appears my question is still there. What purposes the Master (local) serve. The source of truth appears to be the remote/Origin which is the Azure DEVOPS GIT.

Now when I clone the remote/Origin I am basically taking a "copy" (clone. :-) ) and taking it local. I then do a modification and I would create a feature branch...do the work and then issue a PULL request which updates to the feature branch of the remote/Origin when once the PULL request is completed it then goes into the remote/Origin Master.

Is that correct because if so...there was nothing ever done for the Master (local)?

Also, I don't get why it's said this is no central repository and it's distributed. The remote/Origin being the source of truth is a location that everybody clones from, right? So that source of truth is a tangible asset (i.e. where the code source) and it's in a central location as others are getting from it.

I hope you can clear some of this up.

Author

Commented:
Chinmay, what you said on your comment again puts into question on my last comment.

Did what I was saying in my last comment make sense with:

In looking, the link it appears my question is still there. What purposes the Master (local) serve. The source of truth appears to be the remote/Origin which is the Azure DEVOPS GIT.

Now when I clone the remote/Origin I am basically taking a "copy" (clone. :-) ) and taking it local. I then do a modification and I would create a feature branch...do the work and then issue a PULL request which updates to the feature branch of the remote/Origin when once the PULL request is completed it then goes into the remote/Origin Master.

Is that correct because if so...there was nothing ever done for the Master (local)?

Also, I don't get why it's said this is no central repository and it's distributed. The remote/Origin being the source of truth is a location that everybody clones from, right? So that source of truth is a tangible asset (i.e. where the code source) and it's in a central location as others are getting from it.

I hope you can clear some of this up.
Chinmay PatelChief Technology Ninja
Distinguished Expert 2018

Commented:

Now when I clone the remote/Origin I am basically taking a "copy" (clone. :-) ) and taking it local. I then do a modification and I would create a feature branch...do the work and then issue a PULL request which updates to the feature branch of the remote/Origin when once the PULL request is completed it then goes into the remote/Origin Master.
- Yes. And source of truth keeps changing the role. Also think of a team (not an individual) contributing to the repository. Let's say Dave had to change a method and update its signature to support 2 more parameters (He did to accommodate a change request) hence his local repository is the source of truth for that particular file(s).

It is distributed in nature 'cause if you remember VSS or TFS or SVN - they all had one server and the server was the single source of truth (Devs commit their changes and once the changes are accepted in the source - as such similar checks are possible in Git as well).

But Git by design is distributed i.e. any one who has cloned the repository CAN act as a the origin (if required). Also, one common misconception about distributed version control systems is that there cannot be a central project repository. This is simply not true – there is nothing stopping you from saying “this copy of the project is the authoritative one.” This means that instead of a central repository being required by the tools you use, it is now optional and purely a social issue. (Ref: https://www.atlassian.com/blog/software-teams/version-control-centralized-dvcs

Regards,
Chinmay.

Author

Commented:
I'm really not getting this.

Even in the reference document you provide it discusses a central repository and process one goes though:

Pull down any changes other people have made from the central server.
Make your changes, and make sure they work properly.
Commit your changes to the central server, so other programmers can see them.

Now in GIT you clone the master (i.e. pulling from the remote
Make your changes and make sure they work properly
Push your change to the remote/Origin

It's basically the same thing.

Now, heck even in TFS you are pulling something down to your local workspace and can do thing independent (just like if you were on a plane you could do it locally. And just like if you were on a plane you had to connect first to Azure DEVOPS to clone in GIT.)

So, even in your example if they are using like TFS as long as they did a GET LATEST (just like a Daily Pull in GIT). Dave's changes would be the source of truth on this local workspace. In GIT, it would be his source of truth too. But in both situations, if Mary, did some other changes it would not be included. So Mary would have her source of truth without Dave's and visa-versa.

Am I just missing something here??????

Author

Commented:
Am I just missing something?

There seems to be a lot of hype on but everything I have seen it's seems all akin so things that have already been around.

One good thing I am seeing with GIT is that the use of "feature branches" and being able to get rid of them yet keep the history or at least I presume you can.

But I'm not really seeing much difference with the cloning from the remote/origin and the master. It seems as though the local master is basically just no value-add.
Chief Technology Ninja
Distinguished Expert 2018
Commented:
There is one (and a massive one at that too) value add of the Local Master. the local Master is actually a full back up of your entire repo. That is, every check-in, comments, minute details about the repo and that allows you to work offline when you are not connected to server - I know that's not the case most of the time but let's take a scenario. I have taken a flight from New Delhi to NY on Friday - 16+ hours I will be on that flight. I want to see what my Dev Team has done during the entire week - with Git I won't just get the copy of the latest code - I will get everything, I can compare the progress made, can see if they messed up something and then tried to fix it. And that helps in a scenario when the server goes down (Imagine trying to restore a TFS server without backup - not possible right?).

I understand your sentiment about the "Hype", see I come from VSS/TFS background. I am new to Git too but Git is the way going forward.
And I get your point that you feel, things have always been around but then nobody put them in the use the way Git does. And that means? Well Git Wins. Now, what we need to see is where it goes from here.

PS: Microsoft moved Windows repo to https://devblogs.microsoft.com/bharry/scaling-git-and-some-back-story/ to Git in 2017.

Regards,
Chinmay.

Author

Commented:
I get what you are saying but there are also a few challenges I would have too. :-)

If one is relying off a person's Local Master (Cloned) if something happens that is so irresponsible - everybody will have their own cloned version and changes they have done. Yes, you could get the version from the time of the clone and all.  However, that is as irresponsible as not having the source code repository (i.e. TFS) not backed up.

With respect to the link you shared. Thanks! Brian Harry's actually talks about how Microsoft has shifted to GIT also has changed to suit Microsoft needs due to the extreme volume of artifacts (which was always a concern on the cloning). Due to the of aspects of GIT pulling down the entire repository which you say is the massive valid-add, they GIT Virtual File System (GVFS) which yes will pull the repository but break it down to only pull what it needed or scale to what needed. Handling with sub-modules and all like a "super" repo as MS did is good albeit no everybody is using sub-modules yet but rather NuGet feeds. So, it's all good either way. NOTE: on the link, Brian has taken a leave of absence from MS for a year and they are still making changes to TFS so the world isn't GIT. :-) Even parts of MS is not using GVFS. :-)

I got what you are saying; there is value, how much is subjective, and thanks for the discussion and the answering of my OP!
Chinmay PatelChief Technology Ninja
Distinguished Expert 2018

Commented:
If one is relying off a person's Local Master (Cloned) if something happens that is so irresponsible - everybody will have their own cloned version and changes they have done. Yes, you could get the version from the time of the clone and all.  However, that is as irresponsible as not having the source code repository (i.e. TFS) not backed up.
Agreed. But shit happens you know.

:P I like to use Microsoft links to add effect to what I want to say/convey. :P with that said, there are very few organizations in the world which can compete with Microsoft in terms of codebases/repositories (Maybe I am a fanboy as they call me) but then I could not find anymore suitable example. If Windows (even partially to begin with) can move to Git, I think most of us can safely choose Git too.

And on the subjective value, I think there is a still huge room for Git to grow - whether they choose to do so will define their real value in future. As of today, if Git works as flawlessly as TFS for me (at least when it comes to code/artifacts) I am fine.

And THANK YOU, this was a good discussion, I lost the thread in between but I am glad we had this chat. I am sure soon I will have to explain Git and its benefits to a whole set of developers and this thread will come really handy.

Regards,
Chinmay.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial