I have 1 repository and inside 3 branches of AB C. I also created an empty new repository.

How can I take branch B and add it as the main repository?

Or how can I copy branch B, like a normal project, to a computer without any other branches, etc.?

    1 answer 1

    How can I copy branch B as a normal project to a computer? Without any other branches

    clone only one (- single --single-branch ) branch- имя-Π²Π΅Ρ‚ΠΊΠΈ from the repository of the url-Ρ…Ρ€Π°Π½ΠΈΠ»ΠΈΡ‰Π° to the ΠΊΠ°Ρ‚Π°Π»ΠΎΠ³-ΠΊΡƒΠ΄Π°-ΠΊΠ»ΠΎΠ½ΠΈΡ€ΠΎΠ²Π°Ρ‚ΡŒ :

     $ git clone --single-branch -b имя-Π²Π΅Ρ‚ΠΊΠΈ url-Ρ…Ρ€Π°Π½ΠΈΠ»ΠΈΡ‰Π° ΠΊΠ°Ρ‚Π°Π»ΠΎΠ³-ΠΊΡƒΠ΄Π°-ΠΊΠ»ΠΎΠ½ΠΈΡ€ΠΎΠ²Π°Ρ‚ΡŒ