Command to clear the Git Bash screen

与世无争的帅哥 提交于 2019-12-31 08:08:09

问题


Is there any command in Git, that clear the screen. for example in window command line after execute a lot of code, if you type cls, then it will clear all the previous code. so i want the same type of functionality in Git. so can anybody will tell me the command name.


回答1:


Actually you are looking for a Unix user environment command

clear

or you can use the keyboard shortcut

ctrl+l

http://en.wikipedia.org/wiki/Clear_(Unix)

To clear entire command history in Git Bash.

history -c



回答2:


try using reset command, it will absolutely clean your screen but you will still have access to previous commands

reset



回答3:


Another option is modify (or create in your user folder) your .bash_profile and add this:

alias cls='clear';

With this you can clear the bash with a 'Windows' command.




回答4:


Neither clear nor history -c does the work actually.
Scroll up, all commands will be visible.

Solution:
If you are in Windows 10, and using mintty 2.7.9 (or above ?) for git bash, use Alt + F8 ... this will work.
Best of luck.
Happy coding.

Reference: here (Perhaps it didn't work for Windows 7)



来源:https://stackoverflow.com/questions/18704222/command-to-clear-the-git-bash-screen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!