-1

I have followed this tutorial here and made it to this line.

   git remote add production demo@server_domain_or_IP:root

I have a bare repo setup on my remote server and I have verified the username and domain are correct because I use the same user name and domain ( I actually use the IP address ) to ssh into the account.

I have a simple directory name root in the top level directory.

Yet I get this error.

fatal: not a git repository ...

What I tried

I tried changing the folder name to root.git but this did nothing as I expected yet could not think of what else to try.

Research

Receiving "fatal: Not a git repository" when attempting to remote add a Git repo

I don't think this answer is correct, because a bare repo does not have a .git directory. You should not need a .git directory for a folder to be a repo ( It could be a bare repo ).

Community
  • 1
  • 1
cade galt
  • 3,843
  • 8
  • 32
  • 48
  • Where is your repository within the filesystem structure of your server? – Jan Aug 13 '15 at 13:53
  • in the top under the name root... it does not have a .git folder, maybe this is why? – cade galt Aug 13 '15 at 13:54
  • Do you mean directly under root like `/myRepo` or user root's home like `/home/root/myRepo`? Did you init the Repo with `git init`? I don't have a git repo here atm but thought if you did a `git init` it should have a directory `.git` – Jan Aug 13 '15 at 13:57
  • No root is the repo and it is in the top directory. – cade galt Aug 13 '15 at 14:00

2 Answers2

3

You must be in a git working directory to run this command. It is the second answer down in the research link you produced.

1

I am not sure but maybe try

/root

instead of

root

because

without the / it will search root in /home/demo/root.

qräbnö
  • 2,722
  • 27
  • 40