Git Bash can't change directory to documents folder

后端 未结 5 594
陌清茗
陌清茗 2021-02-08 07:42

I\'m trying to following this Github tutorial: https://www.youtube.com/watch?v=73I5dRucCds When I try to change my directory to my desktop, I get this in my Git Shell:

相关标签:
5条回答
  • 2021-02-08 08:03

    Try

    $ cd C:/Users/(YOURUSERNAME)/Desktop
    

    If you are not sure what your username is, then try

    $ cd C:/Users
    

    Then this to see what options are available

    $ ls  
    
    0 讨论(0)
  • 2021-02-08 08:07

    The home directory of cygwin based apps like babun, git-bash, mobaxterm etc. i.e. ~ or $HOME is not the same as windows.

    Windows user path is in the %USERPROFILE% environment variable which in cygwin syntax is /c/Users/YOURUSER (or /cygdrive/c/Users/YOURUSER), like pointed out by the other answers.

    Also, Cygwin based apps handle HOME if it is already set to a custom path in Windows, see the Cygwin FAQ page: https://www.cygwin.com/faq.html#faq.setup.home

    0 讨论(0)
  • 2021-02-08 08:08

    It seems to me you are trying to understand where Documents is.

    To do that open your terminal and type cd, that will change your current directory to your home folder.

    Once in your home, which should look like /c/Users/YOUR-USERNAME, type ls, your Documents folder is there.

    tl;dr cd /c/Users/YOUR-USERNAME/Documents.

    0 讨论(0)
  • 2021-02-08 08:13

    Go to the Directory/Folder where you want to go .Right Click inside that folder and there will be an option called as Git Bash here. click on it .Then a terminal will open with the path of that directory .

    0 讨论(0)
  • 2021-02-08 08:16

    If you run pwd (print working directory) you'll know where you are in your system's file structure and navigate from there.

    Assuming you're on Mac OS X you probably want to do cd ~/Desktop (~ is a shorthand way of getting to your home folder).

    0 讨论(0)
提交回复
热议问题