-1

I have very strange behavior: when run git clone from tcsh script for example:

git clone /my repo/ .

I get error: fatal: destination path '.' already exists and is not an empty directory.

The directory doesn't contain ".git".

if I run the same command after that from terminal it is ok.

version of git 1.9.3

I create this script from python.

I found problem. if I write "#" in line before for comment in tcsh script. Why is it ?

2
  • 1
    Is there a real space in /my repo/? If so you have to put the repo URL in quotes. Commented Aug 17, 2017 at 7:24
  • Please add the verbatim command you entered to tcsh and “terminal” (Bash?) to your question. Commented Aug 17, 2017 at 7:49

1 Answer 1

1

It's because . is a relative path. Try using a full path, it should work.

git clone myRepo /tmp/myDir should work better.

From: https://www.atlassian.com/git/tutorials/setting-up-a-repository/git-clone

Cloning to a specific folder

git clone <repo> <directory>

Clone the repository located at <repo> into the folder called ~<directory>! on the local machine.

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

12 Comments

What is toto ? I tried using full path but it wasn't work
git clone my_repo /tmp/ does not work? Your script has got the exe rights? Chmod +x myScript
And also try using sh not tcsh just to check :)
I create this script from python. Maybe , this reason ?
Let me just try to sum up: you're in a python env or in a python script? From this python env you create a shell (tcsh) script and from there you try to perform a git clone. I'm right? If you try to execute your script outside of python does it work? And have you tried sh rather than tcsh?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.