Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.2k views
in Technique[技术] by (71.8m points)

git - cloning a repo into a new project and then push it to gitlab

I have a need to clone an existing repo into a new one. Repositories are hosted on gitlab. For now i have created a new gitlab repository , and cloned the existing repo into the new one.

  1. mkdir newDirectory
  2. cd newDirectory
  3. git clone ssh://git@git.xyz.com:8888/Project/repo.git
  4. git remote rm origin ( to remove the origin frm existing repo)
  5. git remote add origin ssh://git@git.xyz.com:8888/Project/Newrepo.git

upto here everything worked fine. i checked for branches using command git branch -a - it showed all remote branches.

git push -u origin --all

( it resulted in pushing only master to the new git repo.I want to understand why all the branches are not cloned into the new directory.)

I want to push all the code from existing repo to new including branches, tags and everything.

What i am missing here?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...