Skip to content

WasathTheekshana/github-repo-move

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Duplicate GitHub Repos

Step 1

Change the Remote Origin

git remote add new-origin [email protected]:username/your-new-repo.git

Step 2

Verify the Remote location (optional)

git remote -v

Step 3

Push all branches to the remote repo

git push new-origin --all
git push new-origin --tags

Step 4

Fetch the origin

git fetch origin

Step 5

Create local tracting branches for remote repo

for branch in $(git branch -r | grep 'origin/' | grep -v 'origin/HEAD' | sed 's/origin\///'); do
    git checkout -b "$branch" "origin/$branch"
done

Step 6

Push all branches individually

for branch in $(git branch | sed 's/\* //'); do
    git push new-origin "$branch"
done

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published