Command to clear the Git Bash screen

后端 未结 6 927
广开言路
广开言路 2021-01-30 03:28

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

相关标签:
6条回答
  • 2021-01-30 04:23

    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
    
    0 讨论(0)
  • 2021-01-30 04:25

    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)

    0 讨论(0)
  • 2021-01-30 04:27

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

    reset
    
    0 讨论(0)
  • 2021-01-30 04:29

    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.

    0 讨论(0)
  • 2021-01-30 04:30

    Most times clr, clear and cls doesn't work use ctrl c to continue writing commands

    0 讨论(0)
  • 2021-01-30 04:35

    use clear only without git command

    " clear "

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