Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show files in current directory using Git Bash?

Tags:

How can I check files in current directory, from git bash? Like command dir, in Windows cmd ?

I found a command git ls-files, but it's work only with git repository files. But if I navegate through drive C:\, and want to see files in current directory, how can I do that in git bash?

like image 745
kxc Avatar asked Feb 26 '15 09:02

kxc


People also ask

How do I see files in git bash?

You can also use ls -a to show hidden files and folders. Since it is a Unix shell, you can make an alias called dir in a . bashrc file. It's handy when you are on windows, such that you don't have to remember both the Linux and the Windows command for listing directories.

How do I show files in git?

The Git Show command allows us to view files as they existed in a previous state. The version can be a commit ID, tag, or even a branch name. The file must be the path to a file. For example, the following would output a contents of a file named internal/example/module.go file from a tagged commit called “release-23”.

How do I open the current directory in git bash?

Using Windows Explorer, navigate to any directory you want, type "cmd" in the address bar it will open Windows command prompt in that directory. Along the same lines, if you have the git directory in your path, you can type "git-bash" in the address bar and a Git Shell will open in that directory. Save this answer.


1 Answers

The git bash is basically a Unix shell, therefore you can list current files and directories with the ls command

You can also use ls -a to show hidden files and folders.

Since it is a Unix shell, you can make an alias called dir in a .bashrc file. It's handy when you are on windows, such that you don't have to remember both the Linux and the Windows command for listing directories.

like image 88
ArchiFloyd Avatar answered Oct 14 '22 09:10

ArchiFloyd