Avatar of Marc Davis
Marc Davis
Flag for United States of America asked on

Azure DEVOPS GIT Master and Origin/Master

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.
GitAzureMicrosoft Visual Studio

Avatar of undefined
Last Comment
Chinmay Patel

8/22/2022 - Mon
Chinmay Patel

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,
Marc Davis

ASKER
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 Patel

Push updates Remote from Local and Pull updates Local from Remote.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Marc Davis

ASKER
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.
Marc Davis

ASKER
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 Patel


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.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Marc Davis

ASKER
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??????
Marc Davis

ASKER
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.
ASKER CERTIFIED SOLUTION
Chinmay Patel

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Marc Davis

ASKER
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!
Your help has saved me hundreds of hours of internet surfing.
fblack61
Chinmay Patel

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.