tags:

views:

68

answers:

2

I am trying to add remote using git remote add and than am trying to push to that remote but am getting following errors:

fatal: 'adoshi_01': unable to chdir or not a git archive
and
fatal: The remote end hung up unexpectedly

Steps followed:

  • First of all I cloned from git/repos/scripts to home/adoshi/repos/scripts using command git clone git01.dev:home/git/repos/scripts.git,
  • after doing this I looked at home/git/devs/adoshi folder and there were not entries for scripts and I am still wondering why.
  • Then I tried to add files using git add .
  • Then committed them using git commit –am “Detailed Message”
  • Added remote using git remote add adoshi_01 git01.dev:/home/git/devs/adoshi/scripts/ - Thing to notice there is not scripts folder in git01.dev
  • Tried to push using git push adoshi_git01 master – But again it gave me error

I think main issue here =
On git01.dev:/home/git/devs/adoshi/, “scripts” folder was not created even after I cloned it in 1st and so am still wondering as to what might be the possible reason for that.

Any guidance would be highly appreciated.

A: 

Do you have write permissions on the appropriate directories on the server?

Hank Gay
Yes. I do have...
Rachel
A: 

Using git-push will not create a repository on the other end. Assuming you have shell access to git01.dev, first create a bare repository to hold your public repository:

ssh git01.dev git init --bare /home/git/devs/adoshi/scripts.git

Now clone the shared repo:

git clone git01.dev:/home/git/repos/scripts.git

Now move into your cloned repo and push it to your new bare repository:

cd scripts
git remote add adoshi_01 git01.dev:/home/git/devs/adoshi/scripts.git
git push --all adoshi_01
Greg Bacon
I have followed the same steps mentioned in questions and am getting exact response out as fatal errors also mentioned in email.
Rachel