I have a repo (origin) on a USB key that I cloned on my hard drive (local). I moved \"origin\" to a NAS and successfully tested cloning it from here.
I would like to
You have a lot of ways to do that:
Console
git remote set-url origin [Here new url]
Just be sure that you've opened it in a place where a repository is.
Config
It is placed in .git/config (same folder as repository)
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
[remote "origin"]
url = [Here new url] <------------------------------------
...
TortoiseGit
Then just edit URL.
SourceTree
Click on the "Settings" button on the toolbar to open the Repository Settings window.
Click "Add" to add a remote repository path to the repository. A "Remote details" window will open.
Enter a name for the remote path.
Enter the URL/Path for the remote repository
Enter the username for the hosting service for the remote repository.
Click 'OK' to add the remote path.
Back on the Repository Settings window, click 'OK'. The new remote path should be added on the repository now.
If you need to edit an already added remote path, just click the 'Edit' button. You should be directed to the "Remote details" window where you can edit the details (URL/Path/Host Type) of the remote path.
To remove a remote repository path, click the 'Remove' button
ref. Support
I worked:
git remote set-url origin <project>
git remote set-url {name} {url}
ex) git remote set-url origin https://github.com/myName/GitTest.git
To check git remote connection:
git remote -v
Now, set the local repository to remote git:
git remote set-url origin https://NewRepoLink.git
Now to make it upstream or push use following code:
git push --set-upstream origin master -f
Open Terminal.
Ist Step:- Change the current working directory to your local project.
2nd Step:- List your existing remotes in order to get the name of the remote you want to change.
git remote -v
origin https://github.com/USERNAME/REPOSITORY.git (fetch)
origin https://github.com/USERNAME/REPOSITORY.git (push)
Change your remote's URL from HTTPS to SSH with the git remote set-url command.
3rd Step:- git remote set-url origin git@github.com:USERNAME/REPOSITORY.git
4th Step:- Now Verify that the remote URL has changed.
git remote -v
Verify new remote URL
origin git@github.com:USERNAME/REPOSITORY.git (fetch)
origin git@github.com:USERNAME/REPOSITORY.git (push)
Removing a remote
Use the git remote rm command to remove a remote URL from your repository.
$ git remote -v
# View current remotes
> origin https://github.com/OWNER/REPOSITORY.git (fetch)
> origin https://github.com/OWNER/REPOSITORY.git (push)
> destination https://github.com/FORKER/REPOSITORY.git (fetch)
> destination https://github.com/FORKER/REPOSITORY.git (push)
$ git remote rm destination
# Remove remote
$ git remote -v
# Verify it's gone
> origin https://github.com/OWNER/REPOSITORY.git (fetch)
> origin https://github.com/OWNER/REPOSITORY.git (push)