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.
- mkdir newDirectory
- cd newDirectory
- git clone ssh://[email protected]:8888/Project/repo.git
- git remote rm origin ( to remove the origin frm existing repo)
- 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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…