3

What I have done:

git init git remote add master www.xyz.org/git/arkad fatal: 'origin' does not appear to be a git repository fatal: The remote end hung up unexpectedly 

I have http access to the remote git.

How to fix this?

Thanks.

1
  • 1
    Probably best not to use master as the name of a remote as it is the default name of the main branch. Commented Jun 5, 2012 at 13:56

2 Answers 2

9

You added a remote called "master", not "origin". In your case you would need to do:

git push master master 

You probably want to read the man page for git remote, and you might now want to rename your remote to origin:

git remote rename master origin 

Additionally it appears you didn't specify a protocol to use to talk to the remote: it will probably be either ssh:// or git://. Given the fact there are two problems with your remote config you might want to do the following to correct your configuration:

git remote rm master git remote add origin ssh://www.xyz.org/git/arkad 

Note: this assumes that you need to talk to the server over the ssh protocol, as noted above it could also be that you need to use the git protocol instead.

More useful help can also be found here courtesy of the awesome guys at github.com.

Sign up to request clarification or add additional context in comments.

6 Comments

getting fatal: 'www.xyz.org/git/arkad' does not appear to be a git repository fatal: The remote end hung up unexpectedly
@arnold, are you sure www.xyz.org does really accept SSH connections? Or are you missing http[s]:// may be?
@arnold: You didn't specify the protocol when adding the remote. The command to add a remote really just adds a line in a config file (.git/config): it doesn't verify that you gave it a valid endpoint.
after specifying the protocol its ask for user name and pass then getting error error: src refspec master does not match any.
@kostix I am getting "getting error error: src refspec master does not match any." after specifying the protocol
|
1

You have to push to correct remote server. Just look at here:

git remote -v 

For example my own personal repo gives me:

% git remote -v origin [email protected]:farslan/farslan.github.com.git (fetch) origin [email protected]:farslan/farslan.github.com.git (push) 

Therefore I can use:

git remote origin master 

Comments