0

I just started using git bash today for an Udacity class.

  • I've created a file called test.txt and I've saved it to my desktop.
  • I've created a folder called turnitup in my desktop.
  • I then moved text.txt to the turnitup folder.

I try to move test.txt back to the desktop by using mv test.txt /desktop while I'm in the path ~/desktop/turnitup.

Whenever I do this, I get an error message:

mv: cannot move 'test.txt' to '/desktop' : Permission denied". 

How do I get around this so that I can move the test.txt file back to the desktop location where it was originally created?

1
  • 1
    Nothing to do with Git, it seems.
    – matt
    Commented Feb 21, 2021 at 4:08

1 Answer 1

1

In a Git for Windows bash session / refers to Git installation folder.

So a mv test.txt /desktop is interpreted as rename test.txt as desktop and put it in /.

But / is generally off-limit.

If you are already in /c/Users/<user>/Desktop/turnitup, a simple mv test.txt .. is enough.

Not the answer you're looking for? Browse other questions tagged or ask your own question.