0

When I did "git clone", the Clone Graph shows "unique cloner=1 and clones=2". Tell me why pls.

KAORI
  • 11

1 Answers1

0

your question is like this

it's duplicated.

There are actually three things here: origin master is two separate things, and origin/master is one thing. Three things total.

Two branches:

  • master is a local branch
  • origin/master is a remote branch (which is a local copy of the branch named "master" on the remote named "origin")

One remote:

  • origin is a remote

Example: pull in two steps

Since origin/master is a branch, you can merge it. Here's a pull in two steps:

Step one, fetch master from the remote origin. The master branch on origin will be fetched and the local copy will be named origin/master.

git fetch origin master

Then you merge origin/master into master.

git merge origin/master

Then you can push your new changes in master back to origin:

git push origin master

More examples

You can fetch multiple branches by name...

git fetch origin master stable oldstable

You can merge multiple branches...

git merge origin/master hotfix-2275 hotfix-2276 hotfix-2290
Parisa.H.R
  • 3,303
  • 3
  • 19
  • 38
  • So if I do "git clone" once , it wil be created in both master and origin/master . Right? In the Clone Graph, is "1 clone " means 1 clone action copied to 2 branches? – KAORI Jul 15 '21 at 16:37
  • The term "git origin master" is used in the context of a remote repository. It is used to deal with the remote repository. The term origin comes from where repository original situated and master stands for the main branch. Let's understand both of these terms in detail. Read [this](https://www.javatpoint.com/git-origin-master) – Parisa.H.R Jul 15 '21 at 16:41