-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimprovedGitBashPrompt.txt
60 lines (37 loc) · 1.89 KB
/
improvedGitBashPrompt.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
If you use git bash or cygwin bash, you may want to try this for less speech
verbosity and more braille display space.
The default git bash prompt shows the username and the computername, and
for many people it is not essential to hear it all the time.
We will also add the current git branch to the prompt so that we can be
reminded of what branch we are working on, and will save us from typing git branch -l
1. open git bash, or cygwin bash.
2. copy and paste this long line, remember paste is not done by ctrl+v
but by alt+space, then arrow to edit menu, paste submenu item). It will
download the file and bring you back to the prompt.
curl https://raw.github.com/git/git/master/contrib/completion/git-prompt.sh -o ~/.git-prompt.sh
3. paste the following line and press enter, it shouldn't say anything,
just bring you back to the prompt.
echo 'source ~/.git-prompt.sh' >>~/.bashrc
4. at the prompt type:
cd ~
5. type:
pwd
6. it should have printed something like /c/users/YourUserName if you
are on windows 7.
using explorer navigate to that directory.
if you have explorer set to show hidden files then you should be able to
find a file called .bashrc
(dot bashrc incase your nvda punctuation isnt set to all)
if you don't find it, look in Git installation directory, and copy .bashrc file to directory written above
7. open that file with notepad plus plus
8. go to the last line of the file, and press enter.
9. paste the following line:
export PS1='[\w$(__git_ps1)]$ '
10. save and exit, and restart your git bash. your prompt should be
something like:
[~]$
when you go to a git repo your prompt changes to:
[~/addons/addonTemplate(master)]$
and if you change branch the part in the round brackets will change to
reflect your new working area.
If you have any questions or something doesn't work out for you, please ask on the addon list.