How to make Git-bash command line start up with ho

2020-04-20 10:17发布

问题:

Git-bash.exe is installed at this location:

C:\Program Files\Git

Git-bash.exe starts up with these prompts:

bash: /c/Users/GodCoder/git-prompt.sh: No such file or directory
GodCoder / $ 

(GodCoder is just the username) This file named, 'git-promt.sh' is definitely present at that location, still that promt!

Now, after I tried to print the current working directory which is the same directory where Git-bash is installed i.e. C:\Program Files\Git , it showed this:

GodCoder / $ pwd
/

Now, how to change this, default startup directory to my home directory location which is C:\Users\GodCoder i.e. I want Git-hub.exe to start up like this

GodCoder ~ $  

Instead of starting up in this way

GodCoder / $

How to achieve this GodCoder ~ $?

回答1:

If you are on Windows, do this Right click on the Windows shortcut that you use to launch git bash, and click Properties. Change the value of "Start In" to your desired workspace path i.e. Replace the start in values with "C:\Users\GodCoder"

For more information go to this link: https://classroom.udacity.com/courses/ud775/lessons/2980038599/concepts/33417185870923 It may help you in setting up your enviroment further and also, make sure you restart the application or even the pc and try running in admin or different user modes too!



回答2:

Start your git bash with a /dir like this: git-bash.exe /dir "C:\Users\GodCoder"