0

I just want the copy of remote branch copy into my local branch. Since I don't have privilege to write or merge the code base to remote branch, and having only rights to read. So, how can I clone the copy of remote branch, and keep that copy into some other branch which will create on fly.

Any leads...

ArrchanaMohan
  • 2,314
  • 4
  • 36
  • 84

2 Answers2

2

So you need to "git clone SomeWebRepo" , "git checkout thebranch" and then "git branch CreateSomeNewBranchName?"

or from Git man pages:

Start development from a known tag

           $ git clone git://git.kernel.org/pub/scm/.../linux-2.6 my2.6
           $ cd my2.6
           $ git branch my2.6.14 v2.6.14   (1)
           $ git checkout my2.6.14

This step and the next one could be combined into a single step with "checkout -b my2.6.14 v2.6.14"

OlliWerPXC
  • 111
  • 4
0

So you need to clone the remote repo into a local repo (cloning is synonymous to copying). Once cloned you can just create a new branch from the cloned repo:

git clone [Link to remote]
cd [into git folder]
git fetch [remote-name]
git checkout -b *my_branch*

Now, you can read the code, and may connect with other remote repo on which you may want to push.

Roshan Br
  • 362
  • 2
  • 17