LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 01-12-2010, 03:12 PM   #1
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
GIT: My remote repository moved. How do I tell my local repo to use the new one?


I have a local git repository that pushes to a remote repository. That remote repository moved to a new server. How do I make "git push" and "git pull" push/pull to/from the new repo?

It's probably very simple, but I don't want to screw anything up, so I'm asking first.
 
Old 01-12-2010, 03:55 PM   #2
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
It's as simple as deleting the existing remote, and adding a new one. To view (and then delete the existing remote), do the following:
Code:
First, let's find out what your remote's name was:
$ git remote
origin

Now, let's find out a bit more information about your remote:
$ git remote show origin
* remote origin
...
... yadda yadda yadda
...

Neato, now let's get rid of it.
$ git remote rm origin
To add a new remote:
Code:
$ git remote add origin path_to_new_remote
 
Old 01-20-2010, 09:35 PM   #3
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Original Poster
Rep: Reputation: 51
Thanks for that info! I knew there must be a 'proper' way to do it.

I just went in & edited the .git/remotes/origin file. That works too.
 
Old 01-20-2010, 11:30 PM   #4
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
Anytime.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
git push origin doesn't update the remote repository immediately mohtasham1983 Linux - Server 1 07-15-2009 01:07 PM
How to configure git-daemon to publish my repo? CoderMan Debian 0 06-16-2009 02:18 PM
configuring git public repository geetha_sg Linux - General 0 09-11-2008 11:30 PM
Linux git repository help needed TheDirtyScreech Linux - General 13 08-09-2007 09:56 AM
getting git repository for Wine-0.9.39 in tgz or using windows machine ErV Programming 0 06-25-2007 04:05 AM


All times are GMT -5. The time now is 04:00 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration