Need to change Git URL for repository

List your existing remotes in order to get the name of the remote you want to change (notice we forgot to include .git on the end of the repository directory)

 

cd project
git remote -v
origin ssh://USERNAME@SERVER/HOME/USERNAME/REPOSITORY (fetch) 
origin ssh://USERNAME@SERVER/HOME/USERNAME/REPOSITORY (push)

 

Change your remote’s URL  with the git remote set-url command.

git remote set-url origin ssh://USERNAME@SERVER/HOME/USERNAME/REPOSITORY.git

 

Verify that the remote URL has changed.

git remote -v
# Verify new remote URL
origin ssh://USERNAME@SERVER/HOME/USERNAME/REPOSITORY.git (fetch) 
origin ssh://USERNAME@SERVER/HOME/USERNAME/REPOSITORY.git (push)

 

Git with Visual Studio Express 2013

EXIT Visual Studio!

ndavie@ARIEL-I7 MINGW64 /l/users/ndavie/Documents/Visual Studio 2013/Projects
$ git clone ssh://git@gitserver/home/git/6502Flags.git
Cloning into '6502Flags'...
git@gitserver's password:
remote: Counting objects: 18, done.
remote: Compressing objects: 100% (18/18), done.
Rremote: Total 18 (delta 1), reused 0 (delta 0)
Receiving objects: 100% (18/18), 14.20 KiB | 0 bytes/s, done.
Resolving deltas: 100% (1/1), done.

ndavie@ARIEL-I7 MINGW64 /l/users/ndavie/Documents/Visual Studio 2013/Projects
$ cd 6502Flags

ndavie@ARIEL-I7 MINGW64 /l/users/ndavie/Documents/Visual Studio 2013/Projects/6502Flags (master)
$ git add *
The following paths are ignored by one of your .gitignore files:
6502Flags.v12.suo
Use -f if you really want to add them.

ndavie@ARIEL-I7 MINGW64 /l/users/ndavie/Documents/Visual Studio 2013/Projects/6502Flags (master)
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        modified:   6502Flags/6502Flags.csproj
        modified:   6502Flags/Form1.cs
        modified:   6502Flags/Properties/AssemblyInfo.cs

ndavie@ARIEL-I7 MINGW64 /l/users/ndavie/Documents/Visual Studio 2013/Projects/6502Flags (master)
$ git commit -m "updated version number"
[master 0ac0e95] updated version number
 3 files changed, 38 insertions(+), 3 deletions(-)

ndavie@ARIEL-I7 MINGW64 /l/users/ndavie/Documents/Visual Studio 2013/Projects/6502Flags (master)
$ git push origin master
git@gitserver's password:
Counting objects: 7, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 1.22 KiB | 0 bytes/s, done.
Total 7 (delta 5), reused 0 (delta 0)
To ssh://gitserver/home/git/6502Flags.git
   b681b92..0ac0e95  master -> master

ndavie@ARIEL-I7 MINGW64 /l/users/ndavie/Documents/Visual Studio 2013/Projects/6502Flags (master)
$