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

Categories

0 votes
1.9k 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://[email protected]:8888/Project/repo.git
  4. git remote rm origin ( to remove the origin frm existing repo)
  5. git remote add origin ssh://[email protected]: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 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...