Quantcast
Channel: Git push existing repo to a new and different remote repo server? - Stack Overflow
Viewing all articles
Browse latest Browse all 20

Answer by upe for Git push existing repo to a new and different remote repo server?

$
0
0

Here is a manual way to do git remote set-url origin [new repo URL]:

  1. Clone the repository: git clone <old remote>
  2. Create a GitHub repository
  3. Open <repository>/.git/config

    $ git config -e
    [core]    repositoryformatversion = 0    filemode = false    bare = false    logallrefupdates = true    symlinks = false    ignorecase = true[remote "origin"]    url = <old remote>    fetch = +refs/heads/*:refs/remotes/origin/*[branch "master"]    remote = origin    merge = refs/heads/master

    and change the remote (the url option)

    [remote "origin"]    url = <new remote>    fetch = +refs/heads/*:refs/remotes/origin/*
  4. Push the repository to GitHub: git push

You can also use both/multiple remotes.


Viewing all articles
Browse latest Browse all 20

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>