1

The remote directory already contains a .gitignore file, which I want to overwrite and upload a new one. After doing:

scp -P[portnumber] [email protected]:path/for/file/ location/of/file/.gitignore

I received the following message:

not a regular file

What do I need to do to copy the "not regular file" as well as overwrite the existing one? I'm assuming this question is very basic considering that I can't find the answer anywhere. Thank you!

Christia
  • 215
  • 3
  • 13
  • I have read the following, similar question but it doesn't fully answer my question. http://unix.stackexchange.com/questions/52634/error-using-scp-not-a-regular-file – Christia Nov 03 '16 at 19:29
  • 1
    The syntax is `scp `. Did you mean to copy from `location/of/file/.gitignore` to within `[email protected]:path/for/file/`? If so, you should reverse the order of parameters. – dhag Nov 03 '16 at 19:33
  • I was answering my own question while you were adding this comment. This was actually the source of the problem and if I had known it was that simple, I wouldn't have posted. Sorry! Thanks so much. – Christia Nov 03 '16 at 19:37
  • Possible duplicate of [How to copy a file from a remote server to a local machine?](http://unix.stackexchange.com/questions/188285/how-to-copy-a-file-from-a-remote-server-to-a-local-machine) – heemayl Nov 03 '16 at 20:51

1 Answers1

1

I had my location and destination backwards. I changed it to:

scp -P[portnumber] /path/to/.gitignore [email protected]:/path/to/destination 

That worked!

Christia
  • 215
  • 3
  • 13