I have noticed that on my various (Windows 7) machines running Git that when I open a new Git Bash command prompt I can often access previous commands by pressing the up arrow.
These commands differ from machine to machine, but each machine has the same preset commands every time I open Git Bash. One machine for example lets me scroll thorough git status
and exit
, another has exit
and two blanks lines, while a third machine has no previous commands.
Can anyone say how these are set and what I can do to edit them?
To predefine aliases that stick, put things like
alias gs="git status"
into your ~/.bashrc
.
~
would be C:\\Users\\<username>
in Windows.
Since you were not overly specific with what you wanted:
You seem to want to have a set of commands you can cycle through with up , based on the commands on all the machines you have used lately. (Which are saved locally in ~/.bash_history
on each machine.)
To just have a common history among all machines without some real dirty hackery is not possible, and also just very unlikely worth the effort. On how to achieve the cycle-through functionality, I have no clue.
这些命令存储在bash_history文件中,在Windows中为C:\\Users\\[YOUR USERNAME]\\.bash_history\\
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.