git with "local" remote rep - MacRumors Forums
Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Aug 25, 2013, 12:32 PM   #1
SchodMC
macrumors member
 
Join Date: Jul 2013
Location: Germany
git with "local" remote rep

Hi guys,

Using Xcode with git seems to be a really fine solution. But there is one thing I couldn't figure out how to make it.

I want to create a remote repository on an external USB drive, so that I can push my work to the USB drive from time to time to have an external backup. So I created an new repository on my USB drive using the command "git --bare init" inside the folder where I want to store that repository. Then I switched to my projects directory and added the folder with "git remote add TestAppExternal file://Volumes/External/git\ repositories/testapp/". Everything goes fine, but when I want to push my repository to the "remote" repository on my USB drive using the command "git push -u TestAppExternal master", I got the following error message:

fatal: '/External/git repositories/testapp/' does not appear to be a git repository
fatal: Could not read from remote repository.

So - what I'm doing wrong? Will be nice if someone can help me here.

cu
SchodMC
__________________
13" MBA 2013 // iPad 3rd gen // iPhone 5 // TimeCapsule
SchodMC is offline   0 Reply With Quote
Old Aug 25, 2013, 12:58 PM   #2
thekingofnerds
macrumors regular
 
Join Date: Jun 2013
Don't use file:// when you do git remote add

Remove the current remote repo and do:

Code:
git remote add TestAppExternal /Volumes/External/git\ repositories/testapp/
Just tested real quick - when you add file:// it makes it think the external HD is relative to root, rather than relative to /Volumes. Not entirely sure why - seems like it may be a bug.
thekingofnerds is offline   0 Reply With Quote
Old Aug 25, 2013, 01:05 PM   #3
SchodMC
Thread Starter
macrumors member
 
Join Date: Jul 2013
Location: Germany
Quote:
Originally Posted by thekingofnerds View Post
Don't use file:// when you do git remote add

Remove the current remote repo and do:

Code:
git remote add TestAppExternal /Volumes/External/git\ repositories/testapp/
Just tested real quick - when you add file:// it makes it think the external HD is relative to root, rather than relative to /Volumes. Not entirely sure why - seems like it may be a bug.
Hey - that works. Even Xcode will now accept the remote repository for push / pull operations. Thank you very much.

cu
SchodMC
__________________
13" MBA 2013 // iPad 3rd gen // iPhone 5 // TimeCapsule
SchodMC is offline   0 Reply With Quote
Old Aug 25, 2013, 01:25 PM   #4
chown33
macrumors 603
 
Join Date: Aug 2009
Quote:
Originally Posted by thekingofnerds View Post
Don't use file:// when you do git remote add

Remove the current remote repo and do:

Code:
git remote add TestAppExternal /Volumes/External/git\ repositories/testapp/
Just tested real quick - when you add file:// it makes it think the external HD is relative to root, rather than relative to /Volumes. Not entirely sure why - seems like it may be a bug.
Try it with 3 slashes, e.g. file:///Volumes/External/pathname.

Or try file://localhost/Volumes/External/pathname.

The OP's error message was:
Code:
fatal: '/External/git repositories/testapp/' does not appear to be a git repository
To me, this looks like the //Volumes part is being interpreted as a hostname, which is correct according to the latest RFCs.
http://en.wikipedia.org/wiki/File_URI_scheme#Format
Note that when omitting host you do not omit the slash ("file:///foo.txt" is okay, while "file://foo.txt" is not, although some interpreters manage to handle the latter).
Also see the "Examples" section for examples.
chown33 is offline   1 Reply With Quote
Old Aug 25, 2013, 02:10 PM   #5
thekingofnerds
macrumors regular
 
Join Date: Jun 2013
Quote:
Originally Posted by chown33 View Post
To me, this looks like the //Volumes part is being interpreted as a hostname, which is correct according to the latest RFCs.
http://en.wikipedia.org/wiki/File_URI_scheme#Format
Note that when omitting host you do not omit the slash ("file:///foo.txt" is okay, while "file://foo.txt" is not, although some interpreters manage to handle the latter).
Also see the "Examples" section for examples.
That explains it. Thanks.
thekingofnerds is offline   0 Reply With Quote
Old Aug 25, 2013, 05:27 PM   #6
SchodMC
Thread Starter
macrumors member
 
Join Date: Jul 2013
Location: Germany
Quote:
Originally Posted by chown33 View Post
Try it with 3 slashes, e.g. file:///Volumes/External/pathname.

Or try file://localhost/Volumes/External/pathname.

The OP's error message was:
Code:
fatal: '/External/git repositories/testapp/' does not appear to be a git repository
To me, this looks like the //Volumes part is being interpreted as a hostname, which is correct according to the latest RFCs.
http://en.wikipedia.org/wiki/File_URI_scheme#Format
Note that when omitting host you do not omit the slash ("file:///foo.txt" is okay, while "file://foo.txt" is not, although some interpreters manage to handle the latter).
Also see the "Examples" section for examples.
Just tried it out with file:/// and file://localhost/ - both worked fine. Learned an other thing - thanks for that.

cu
SchodMC
__________________
13" MBA 2013 // iPad 3rd gen // iPhone 5 // TimeCapsule
SchodMC is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Rep. Tammy Duckworth Dresses down "Disabled" IRS Contractor bradl Politics, Religion, Social Issues 25 Jun 29, 2013 12:03 PM
What can I do when git with "?A" status mikezang iPhone/iPad Programming 2 Jan 21, 2013 05:03 PM
Remote disc when the "host" computer is wired and my macbook pro is "wireless" SilentLoner MacBook Pro 2 Nov 15, 2012 10:48 AM
"Let's hurl some acid at those female Democratic senators" -- PR for Rep. Hayworth jnpy!$4g3cwk Politics, Religion, Social Issues 35 Jun 7, 2012 09:38 AM

Forum Jump

All times are GMT -5. The time now is 05:08 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC