how do I add the 'tree' command to git-bash on Windows?
I'm using git-bash on Windows 7. I'd like to see a tree of the current directory. However:
jcollum@DEVELOPER01 ~/Dev/express_coffee
$ tree .
sh.exe": tree: command not found
OK, so I don't have the tree command. How do I install it? I found an article but it was for Macs.
windows-7 bash git git-bash
add a comment |
I'm using git-bash on Windows 7. I'd like to see a tree of the current directory. However:
jcollum@DEVELOPER01 ~/Dev/express_coffee
$ tree .
sh.exe": tree: command not found
OK, so I don't have the tree command. How do I install it? I found an article but it was for Macs.
windows-7 bash git git-bash
git-bashis really just a cut down version of Cygwin. Best way to go is install Cygwin from cygwin.com, and use the package manager there to installtreeor whatever package it's in (if it exists).
– allquixotic
Jan 14 '13 at 16:35
2
@allquixotic actually these days it's mingw
– jcollum
Jan 14 '13 at 16:47
add a comment |
I'm using git-bash on Windows 7. I'd like to see a tree of the current directory. However:
jcollum@DEVELOPER01 ~/Dev/express_coffee
$ tree .
sh.exe": tree: command not found
OK, so I don't have the tree command. How do I install it? I found an article but it was for Macs.
windows-7 bash git git-bash
I'm using git-bash on Windows 7. I'd like to see a tree of the current directory. However:
jcollum@DEVELOPER01 ~/Dev/express_coffee
$ tree .
sh.exe": tree: command not found
OK, so I don't have the tree command. How do I install it? I found an article but it was for Macs.
windows-7 bash git git-bash
windows-7 bash git git-bash
edited Jan 14 '13 at 16:31
asked Jan 9 '13 at 18:22
jcollum
1,83893349
1,83893349
git-bashis really just a cut down version of Cygwin. Best way to go is install Cygwin from cygwin.com, and use the package manager there to installtreeor whatever package it's in (if it exists).
– allquixotic
Jan 14 '13 at 16:35
2
@allquixotic actually these days it's mingw
– jcollum
Jan 14 '13 at 16:47
add a comment |
git-bashis really just a cut down version of Cygwin. Best way to go is install Cygwin from cygwin.com, and use the package manager there to installtreeor whatever package it's in (if it exists).
– allquixotic
Jan 14 '13 at 16:35
2
@allquixotic actually these days it's mingw
– jcollum
Jan 14 '13 at 16:47
git-bash is really just a cut down version of Cygwin. Best way to go is install Cygwin from cygwin.com, and use the package manager there to install tree or whatever package it's in (if it exists).– allquixotic
Jan 14 '13 at 16:35
git-bash is really just a cut down version of Cygwin. Best way to go is install Cygwin from cygwin.com, and use the package manager there to install tree or whatever package it's in (if it exists).– allquixotic
Jan 14 '13 at 16:35
2
2
@allquixotic actually these days it's mingw
– jcollum
Jan 14 '13 at 16:47
@allquixotic actually these days it's mingw
– jcollum
Jan 14 '13 at 16:47
add a comment |
8 Answers
8
active
oldest
votes
You could also use "cmd //c tree" to use Windows' tree
Explanation:
- Launch cmd with '/c' argument and run tree, then terminate
/C Carries out the command specified by string and then
terminates
(extra slash for escaping)
/a use to run with ascii chars in case it doesn't display right.
Answered in greater detail here: https://stackoverflow.com/q/515309/1261166
add a comment |
I have downloaded the tree.exe inside the zip file from here http://gnuwin32.sourceforge.net/packages/tree.htm as suggested.
Then I have extracted the tree.exe file to C:Program FilesGitusrbin (I have added this folder to windows path to make it work with the regular CMD but it works with GITBash too).

I hope this helps you somehow !
2
Works very well with git-bash on Windows 7, thanks!
– cjauvin
Dec 12 '16 at 21:18
2
tree.exe copied to C:Program FilesGitusrbin is what we were looking for. Great share . Thanks. downloads.sourceforge.net/gnuwin32/tree-1.5.2.2-bin.zip Download the zip specified for binaries it has tree.exe. Contrary try to download from the original site.
– Doogle
Dec 29 '17 at 17:03
In windows 10 I put this inC:UsersmyuserAppDataLocalProgramsGitusrbinI think the rule of thumb is to find where bash.exe or git.exe are located, go up a folder, then find usr/bin/ and put tree there
– Charles L.
Sep 7 '18 at 19:32
add a comment |
The GnuWin32 build of tree is at http://gnuwin32.sourceforge.net/packages/tree.htm - you'd need to add it to your path manually if you're not already using GnuWin32.
If you want to use it at a Windows console also you'd need to rename or copy tree.exe to something else, e.g. lstree.exe, otherwise the Windows tree command will take precedence. The advantage of the GnuWin version is that it has lots of options - e.g. tree -L 2 would limit the recursion depth to 2.
> tree --help
usage: tree [-adfghilnpqrstuvxACDFNS] [-H baseHREF] [-T title ] [-L level [-R]]
[-P pattern] [-I pattern] [-o filename] [--version] [--help] [--inodes]
[--device] [--noreport] [--nolinks] [--dirsfirst] [--charset charset]
[--filelimit #] [<directory list>]
-a All files are listed.
-d List directories only.
-l Follow symbolic links like directories.
-f Print the full path prefix for each file.
-i Don't print indentation lines.
-q Print non-printable characters as '?'.
-N Print non-printable characters as is.
-p Print the protections for each file.
-u Displays file owner or UID number.
-g Displays file group owner or GID number.
-s Print the size in bytes of each file.
-h Print the size in a more human readable way.
-D Print the date of last modification.
-F Appends '/', '=', '*', or '|' as per ls -F.
-v Sort files alphanumerically by version.
-r Sort files in reverse alphanumeric order.
-t Sort files by last modification time.
-x Stay on current filesystem only.
-L level Descend only level directories deep.
-A Print ANSI lines graphic indentation lines.
-S Print with ASCII graphics indentation lines.
-n Turn colorization off always (-C overrides).
-C Turn colorization on always.
-P pattern List only those files that match the pattern given.
-I pattern Do not list files that match the given pattern.
-H baseHREF Prints out HTML format with baseHREF as top directory.
-T string Replace the default HTML title and H1 header with string.
-R Rerun tree when max dir level reached.
-o file Output to file instead of stdout.
--inodes Print inode number of each file.
--device Print device ID number to which each file belongs.
--noreport Turn off file/directory count at end of tree listing.
--nolinks Turn off hyperlinks in HTML output.
--dirsfirst List directories before files.
--charset X Use charset X for HTML and indentation line output.
--filelimit # Do not descend dirs with more than # files in them.
Compared to the Windows tree:
> tree /?
Graphically displays the folder structure of a drive or path.
TREE [drive:][path] [/F] [/A]
/F Display the names of the files in each folder.
/A Use ASCII instead of extended characters.
IMO, this is the most straight forward way to get tree cmd in Cygwin and I tried the compilation route before unsuccessfully. With this you just download the binary, extract it to a folder on your cygwins path and violla, tree command out of the box
– iloveretards
Apr 11 '16 at 18:53
in cygwin:apt-cyg install treeandtree.exewill be in the cygwinbinfolder.
– Timo
Oct 26 '17 at 10:03
add a comment |
There is a tree command in windows already - only problem is it is tree.com and git bash will not automatically add extension .com and execute it.
However it will find it if you press tab after you type tree or tre
To see files you have to use //f - you have to use // or bash will think it is folder name
I also used //a to show ascii lines but you don't have to use it
Example:
dean@dean:~/java$ tree
bash: tree: command not found
dean@dean:~/java$ tree.com //a
Folder PATH listing for volume c
Volume serial number is 4E70-B37A
C:.
+---atom
+---sublime
---vscode
dean@dean:~/java$ tree.com //a //f
Folder PATH listing for volume c
Volume serial number is 4E70-B37A
C:.
+---atom
| test1
|
+---sublime
| test2
|
---vscode
test3
dean@dean:~/java$
awesome, worked like a charm..
– Santosh Kumar A
Oct 20 '18 at 7:13
add a comment |
git-bash is really just a cut down version of mingw. Install Cygwin from cygwin.com, and then either use the package manager to install 'tree' or whatever package it's in, or if it doesn't exist, then install gcc, download the tree source from here:
http://mama.indstate.edu/users/ice/tree/
Then follow the instructions in the INSTALL file (make, make install)
So is it impossible in minggw?
– Jen S.
Jan 21 '14 at 9:27
1
I'd imagine it isn't too hard from mingw, but isn't possible from your default git-bash prompt, because I imagine that git-bash doesn't come with tools you need like a C/C++ compiler. But you could try installing mingw, making sure to include gcc, and following the instructions in the tree INSTALL file. I have used mingw to compile things like this on Windows in the past, so this part is definitely possible.
– Jonathan Hartley
Jan 22 '14 at 9:30
add a comment |
You must install the Three for Windows as said above by the link: http://gnuwin32.sourceforge.net/packages/tree.htm
Besides that you need to add the tree program to your windows path or the tree command will be available only on cmd. Access your windows path and add this (for default installation):
;C:Program Files (x86)GnuWin32bin
Them you will be able to use tree command on git bash on windows.
add a comment |
This is the beginning of my .gitconfig file :
I made an alias for log --graph
# This is Git's per-user configuration file.
[user]
# Please adapt and uncomment the following lines:
name = xxxxxx
email = xxx@xxx.xxx
[alias]
tree = log --graph --oneline --all --pretty=format:'%C(yellow)%h%Creset -%Cred%d%Creset %s %Cgreen%cr%Creset %C(cyan)%an%Creset %gn'
Not the solution. The alias shows the commit and not the files / dirs.
– Timo
Oct 26 '17 at 10:01
add a comment |
Git for Windows (https://gitforwindows.org/) (has Git Bash) but it does not include tree. tree is available for via pacman (Package Manager) but that is only available if you install "Git for Windows SDK" (scroll to the bottom of gitforwindows.org/ which provides a link to download installer for it from https://github.com/git-for-windows/build-extra/releases/latest)
This SO: "Package management in git for windows?" was very helpful
https://stackoverflow.com/questions/32712133/package-management-in-git-for-windows
Also as commented in the above SO, they link to this git for windows issue [Pacman missing on fresh 2.5.2 install #397] that it was intended to not include pacman in the default install.
Anyways, I installed "Git for Windows SDK", then in it's bash prompt (SDK-64) I ran the
following to install current tree v1.7.0-1 (as of this posting Aug 30, 2018):
[SDK-64: Bash Terminal for Git for Windows SDK]
pacman -S tree
...
Proceed with installation? [Y/n] Y
On my system, Git for Windows SDK is installed under: C:git-sdk-64, so from my Git for Windows Bash shell (that did not have tree installed), I copied it over tree.exe to it's /usr/bin directory, e.g.
[MINGW64: Bash Terminal for Git for Windows]
cd /usr/bin
cp /c/git-sdk-64/usr/bin/tree.exe .
Now I can run tree v1.7.0 from both Git Bash shells.
So, to make it even easier for others and maybe myself on a future machine, I looked at where pacman was getting the tree package from by running following in my Git for Windows SDK Bash terminal:
$ pacman -S --info tree
Repository : msys
Name : tree
Version : 1.7.0-1
Description : A directory listing program displaying a depth indented list of files
Architecture : x86_64
...
The key thing, here is that pacman is getting it from the "msys" repository (FYI: even though it says msys, it really is using msys2), so I looked at /etc/pacman.d/mirrorlist.msys and the first mirror points to http://repo.msys2.org/msys/$arch/
So next time you want a package that is NOT in Git for Windows, you can download them from: http://repo.msys2.org/msys/x86_64/ (for 64-bit) or from http://repo.msys2.org/msys/i686/ (32-bit)
e.g. direct download link for tree v1.7.0-1
- 64-bit: http://repo.msys2.org/msys/x86_64/tree-1.7.0-1-x86_64.pkg.tar.xz
- or https://sourceforge.net/projects/msys2/files/REPOS/MSYS2/x86_64/tree-1.7.0-1-x86_64.pkg.tar.xz
- 32-bit: http://repo.msys2.org/msys/i686/tree-1.7.0-1-i686.pkg.tar.xz
- or https://sourceforge.net/projects/msys2/files/REPOS/MSYS2/i686/tree-1.7.0-1-i686.pkg.tar.xz
1
FYI: Git SCM's Window's download at git-scm.com/download pulls the latest from Git for Windows GitHub (github.com/git-for-windows/git/releases) from github.com/git-for-windows/git
– N. Ngo
Aug 30 '18 at 20:58
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f531592%2fhow-do-i-add-the-tree-command-to-git-bash-on-windows%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
8 Answers
8
active
oldest
votes
8 Answers
8
active
oldest
votes
active
oldest
votes
active
oldest
votes
You could also use "cmd //c tree" to use Windows' tree
Explanation:
- Launch cmd with '/c' argument and run tree, then terminate
/C Carries out the command specified by string and then
terminates
(extra slash for escaping)
/a use to run with ascii chars in case it doesn't display right.
Answered in greater detail here: https://stackoverflow.com/q/515309/1261166
add a comment |
You could also use "cmd //c tree" to use Windows' tree
Explanation:
- Launch cmd with '/c' argument and run tree, then terminate
/C Carries out the command specified by string and then
terminates
(extra slash for escaping)
/a use to run with ascii chars in case it doesn't display right.
Answered in greater detail here: https://stackoverflow.com/q/515309/1261166
add a comment |
You could also use "cmd //c tree" to use Windows' tree
Explanation:
- Launch cmd with '/c' argument and run tree, then terminate
/C Carries out the command specified by string and then
terminates
(extra slash for escaping)
/a use to run with ascii chars in case it doesn't display right.
Answered in greater detail here: https://stackoverflow.com/q/515309/1261166
You could also use "cmd //c tree" to use Windows' tree
Explanation:
- Launch cmd with '/c' argument and run tree, then terminate
/C Carries out the command specified by string and then
terminates
(extra slash for escaping)
/a use to run with ascii chars in case it doesn't display right.
Answered in greater detail here: https://stackoverflow.com/q/515309/1261166
edited Dec 19 '18 at 12:39
answered Jun 2 '14 at 12:27
Viktor Mellgren
485414
485414
add a comment |
add a comment |
I have downloaded the tree.exe inside the zip file from here http://gnuwin32.sourceforge.net/packages/tree.htm as suggested.
Then I have extracted the tree.exe file to C:Program FilesGitusrbin (I have added this folder to windows path to make it work with the regular CMD but it works with GITBash too).

I hope this helps you somehow !
2
Works very well with git-bash on Windows 7, thanks!
– cjauvin
Dec 12 '16 at 21:18
2
tree.exe copied to C:Program FilesGitusrbin is what we were looking for. Great share . Thanks. downloads.sourceforge.net/gnuwin32/tree-1.5.2.2-bin.zip Download the zip specified for binaries it has tree.exe. Contrary try to download from the original site.
– Doogle
Dec 29 '17 at 17:03
In windows 10 I put this inC:UsersmyuserAppDataLocalProgramsGitusrbinI think the rule of thumb is to find where bash.exe or git.exe are located, go up a folder, then find usr/bin/ and put tree there
– Charles L.
Sep 7 '18 at 19:32
add a comment |
I have downloaded the tree.exe inside the zip file from here http://gnuwin32.sourceforge.net/packages/tree.htm as suggested.
Then I have extracted the tree.exe file to C:Program FilesGitusrbin (I have added this folder to windows path to make it work with the regular CMD but it works with GITBash too).

I hope this helps you somehow !
2
Works very well with git-bash on Windows 7, thanks!
– cjauvin
Dec 12 '16 at 21:18
2
tree.exe copied to C:Program FilesGitusrbin is what we were looking for. Great share . Thanks. downloads.sourceforge.net/gnuwin32/tree-1.5.2.2-bin.zip Download the zip specified for binaries it has tree.exe. Contrary try to download from the original site.
– Doogle
Dec 29 '17 at 17:03
In windows 10 I put this inC:UsersmyuserAppDataLocalProgramsGitusrbinI think the rule of thumb is to find where bash.exe or git.exe are located, go up a folder, then find usr/bin/ and put tree there
– Charles L.
Sep 7 '18 at 19:32
add a comment |
I have downloaded the tree.exe inside the zip file from here http://gnuwin32.sourceforge.net/packages/tree.htm as suggested.
Then I have extracted the tree.exe file to C:Program FilesGitusrbin (I have added this folder to windows path to make it work with the regular CMD but it works with GITBash too).

I hope this helps you somehow !
I have downloaded the tree.exe inside the zip file from here http://gnuwin32.sourceforge.net/packages/tree.htm as suggested.
Then I have extracted the tree.exe file to C:Program FilesGitusrbin (I have added this folder to windows path to make it work with the regular CMD but it works with GITBash too).

I hope this helps you somehow !
answered Nov 2 '16 at 8:52
Pini Cheyni
30937
30937
2
Works very well with git-bash on Windows 7, thanks!
– cjauvin
Dec 12 '16 at 21:18
2
tree.exe copied to C:Program FilesGitusrbin is what we were looking for. Great share . Thanks. downloads.sourceforge.net/gnuwin32/tree-1.5.2.2-bin.zip Download the zip specified for binaries it has tree.exe. Contrary try to download from the original site.
– Doogle
Dec 29 '17 at 17:03
In windows 10 I put this inC:UsersmyuserAppDataLocalProgramsGitusrbinI think the rule of thumb is to find where bash.exe or git.exe are located, go up a folder, then find usr/bin/ and put tree there
– Charles L.
Sep 7 '18 at 19:32
add a comment |
2
Works very well with git-bash on Windows 7, thanks!
– cjauvin
Dec 12 '16 at 21:18
2
tree.exe copied to C:Program FilesGitusrbin is what we were looking for. Great share . Thanks. downloads.sourceforge.net/gnuwin32/tree-1.5.2.2-bin.zip Download the zip specified for binaries it has tree.exe. Contrary try to download from the original site.
– Doogle
Dec 29 '17 at 17:03
In windows 10 I put this inC:UsersmyuserAppDataLocalProgramsGitusrbinI think the rule of thumb is to find where bash.exe or git.exe are located, go up a folder, then find usr/bin/ and put tree there
– Charles L.
Sep 7 '18 at 19:32
2
2
Works very well with git-bash on Windows 7, thanks!
– cjauvin
Dec 12 '16 at 21:18
Works very well with git-bash on Windows 7, thanks!
– cjauvin
Dec 12 '16 at 21:18
2
2
tree.exe copied to C:Program FilesGitusrbin is what we were looking for. Great share . Thanks. downloads.sourceforge.net/gnuwin32/tree-1.5.2.2-bin.zip Download the zip specified for binaries it has tree.exe. Contrary try to download from the original site.
– Doogle
Dec 29 '17 at 17:03
tree.exe copied to C:Program FilesGitusrbin is what we were looking for. Great share . Thanks. downloads.sourceforge.net/gnuwin32/tree-1.5.2.2-bin.zip Download the zip specified for binaries it has tree.exe. Contrary try to download from the original site.
– Doogle
Dec 29 '17 at 17:03
In windows 10 I put this in
C:UsersmyuserAppDataLocalProgramsGitusrbin I think the rule of thumb is to find where bash.exe or git.exe are located, go up a folder, then find usr/bin/ and put tree there– Charles L.
Sep 7 '18 at 19:32
In windows 10 I put this in
C:UsersmyuserAppDataLocalProgramsGitusrbin I think the rule of thumb is to find where bash.exe or git.exe are located, go up a folder, then find usr/bin/ and put tree there– Charles L.
Sep 7 '18 at 19:32
add a comment |
The GnuWin32 build of tree is at http://gnuwin32.sourceforge.net/packages/tree.htm - you'd need to add it to your path manually if you're not already using GnuWin32.
If you want to use it at a Windows console also you'd need to rename or copy tree.exe to something else, e.g. lstree.exe, otherwise the Windows tree command will take precedence. The advantage of the GnuWin version is that it has lots of options - e.g. tree -L 2 would limit the recursion depth to 2.
> tree --help
usage: tree [-adfghilnpqrstuvxACDFNS] [-H baseHREF] [-T title ] [-L level [-R]]
[-P pattern] [-I pattern] [-o filename] [--version] [--help] [--inodes]
[--device] [--noreport] [--nolinks] [--dirsfirst] [--charset charset]
[--filelimit #] [<directory list>]
-a All files are listed.
-d List directories only.
-l Follow symbolic links like directories.
-f Print the full path prefix for each file.
-i Don't print indentation lines.
-q Print non-printable characters as '?'.
-N Print non-printable characters as is.
-p Print the protections for each file.
-u Displays file owner or UID number.
-g Displays file group owner or GID number.
-s Print the size in bytes of each file.
-h Print the size in a more human readable way.
-D Print the date of last modification.
-F Appends '/', '=', '*', or '|' as per ls -F.
-v Sort files alphanumerically by version.
-r Sort files in reverse alphanumeric order.
-t Sort files by last modification time.
-x Stay on current filesystem only.
-L level Descend only level directories deep.
-A Print ANSI lines graphic indentation lines.
-S Print with ASCII graphics indentation lines.
-n Turn colorization off always (-C overrides).
-C Turn colorization on always.
-P pattern List only those files that match the pattern given.
-I pattern Do not list files that match the given pattern.
-H baseHREF Prints out HTML format with baseHREF as top directory.
-T string Replace the default HTML title and H1 header with string.
-R Rerun tree when max dir level reached.
-o file Output to file instead of stdout.
--inodes Print inode number of each file.
--device Print device ID number to which each file belongs.
--noreport Turn off file/directory count at end of tree listing.
--nolinks Turn off hyperlinks in HTML output.
--dirsfirst List directories before files.
--charset X Use charset X for HTML and indentation line output.
--filelimit # Do not descend dirs with more than # files in them.
Compared to the Windows tree:
> tree /?
Graphically displays the folder structure of a drive or path.
TREE [drive:][path] [/F] [/A]
/F Display the names of the files in each folder.
/A Use ASCII instead of extended characters.
IMO, this is the most straight forward way to get tree cmd in Cygwin and I tried the compilation route before unsuccessfully. With this you just download the binary, extract it to a folder on your cygwins path and violla, tree command out of the box
– iloveretards
Apr 11 '16 at 18:53
in cygwin:apt-cyg install treeandtree.exewill be in the cygwinbinfolder.
– Timo
Oct 26 '17 at 10:03
add a comment |
The GnuWin32 build of tree is at http://gnuwin32.sourceforge.net/packages/tree.htm - you'd need to add it to your path manually if you're not already using GnuWin32.
If you want to use it at a Windows console also you'd need to rename or copy tree.exe to something else, e.g. lstree.exe, otherwise the Windows tree command will take precedence. The advantage of the GnuWin version is that it has lots of options - e.g. tree -L 2 would limit the recursion depth to 2.
> tree --help
usage: tree [-adfghilnpqrstuvxACDFNS] [-H baseHREF] [-T title ] [-L level [-R]]
[-P pattern] [-I pattern] [-o filename] [--version] [--help] [--inodes]
[--device] [--noreport] [--nolinks] [--dirsfirst] [--charset charset]
[--filelimit #] [<directory list>]
-a All files are listed.
-d List directories only.
-l Follow symbolic links like directories.
-f Print the full path prefix for each file.
-i Don't print indentation lines.
-q Print non-printable characters as '?'.
-N Print non-printable characters as is.
-p Print the protections for each file.
-u Displays file owner or UID number.
-g Displays file group owner or GID number.
-s Print the size in bytes of each file.
-h Print the size in a more human readable way.
-D Print the date of last modification.
-F Appends '/', '=', '*', or '|' as per ls -F.
-v Sort files alphanumerically by version.
-r Sort files in reverse alphanumeric order.
-t Sort files by last modification time.
-x Stay on current filesystem only.
-L level Descend only level directories deep.
-A Print ANSI lines graphic indentation lines.
-S Print with ASCII graphics indentation lines.
-n Turn colorization off always (-C overrides).
-C Turn colorization on always.
-P pattern List only those files that match the pattern given.
-I pattern Do not list files that match the given pattern.
-H baseHREF Prints out HTML format with baseHREF as top directory.
-T string Replace the default HTML title and H1 header with string.
-R Rerun tree when max dir level reached.
-o file Output to file instead of stdout.
--inodes Print inode number of each file.
--device Print device ID number to which each file belongs.
--noreport Turn off file/directory count at end of tree listing.
--nolinks Turn off hyperlinks in HTML output.
--dirsfirst List directories before files.
--charset X Use charset X for HTML and indentation line output.
--filelimit # Do not descend dirs with more than # files in them.
Compared to the Windows tree:
> tree /?
Graphically displays the folder structure of a drive or path.
TREE [drive:][path] [/F] [/A]
/F Display the names of the files in each folder.
/A Use ASCII instead of extended characters.
IMO, this is the most straight forward way to get tree cmd in Cygwin and I tried the compilation route before unsuccessfully. With this you just download the binary, extract it to a folder on your cygwins path and violla, tree command out of the box
– iloveretards
Apr 11 '16 at 18:53
in cygwin:apt-cyg install treeandtree.exewill be in the cygwinbinfolder.
– Timo
Oct 26 '17 at 10:03
add a comment |
The GnuWin32 build of tree is at http://gnuwin32.sourceforge.net/packages/tree.htm - you'd need to add it to your path manually if you're not already using GnuWin32.
If you want to use it at a Windows console also you'd need to rename or copy tree.exe to something else, e.g. lstree.exe, otherwise the Windows tree command will take precedence. The advantage of the GnuWin version is that it has lots of options - e.g. tree -L 2 would limit the recursion depth to 2.
> tree --help
usage: tree [-adfghilnpqrstuvxACDFNS] [-H baseHREF] [-T title ] [-L level [-R]]
[-P pattern] [-I pattern] [-o filename] [--version] [--help] [--inodes]
[--device] [--noreport] [--nolinks] [--dirsfirst] [--charset charset]
[--filelimit #] [<directory list>]
-a All files are listed.
-d List directories only.
-l Follow symbolic links like directories.
-f Print the full path prefix for each file.
-i Don't print indentation lines.
-q Print non-printable characters as '?'.
-N Print non-printable characters as is.
-p Print the protections for each file.
-u Displays file owner or UID number.
-g Displays file group owner or GID number.
-s Print the size in bytes of each file.
-h Print the size in a more human readable way.
-D Print the date of last modification.
-F Appends '/', '=', '*', or '|' as per ls -F.
-v Sort files alphanumerically by version.
-r Sort files in reverse alphanumeric order.
-t Sort files by last modification time.
-x Stay on current filesystem only.
-L level Descend only level directories deep.
-A Print ANSI lines graphic indentation lines.
-S Print with ASCII graphics indentation lines.
-n Turn colorization off always (-C overrides).
-C Turn colorization on always.
-P pattern List only those files that match the pattern given.
-I pattern Do not list files that match the given pattern.
-H baseHREF Prints out HTML format with baseHREF as top directory.
-T string Replace the default HTML title and H1 header with string.
-R Rerun tree when max dir level reached.
-o file Output to file instead of stdout.
--inodes Print inode number of each file.
--device Print device ID number to which each file belongs.
--noreport Turn off file/directory count at end of tree listing.
--nolinks Turn off hyperlinks in HTML output.
--dirsfirst List directories before files.
--charset X Use charset X for HTML and indentation line output.
--filelimit # Do not descend dirs with more than # files in them.
Compared to the Windows tree:
> tree /?
Graphically displays the folder structure of a drive or path.
TREE [drive:][path] [/F] [/A]
/F Display the names of the files in each folder.
/A Use ASCII instead of extended characters.
The GnuWin32 build of tree is at http://gnuwin32.sourceforge.net/packages/tree.htm - you'd need to add it to your path manually if you're not already using GnuWin32.
If you want to use it at a Windows console also you'd need to rename or copy tree.exe to something else, e.g. lstree.exe, otherwise the Windows tree command will take precedence. The advantage of the GnuWin version is that it has lots of options - e.g. tree -L 2 would limit the recursion depth to 2.
> tree --help
usage: tree [-adfghilnpqrstuvxACDFNS] [-H baseHREF] [-T title ] [-L level [-R]]
[-P pattern] [-I pattern] [-o filename] [--version] [--help] [--inodes]
[--device] [--noreport] [--nolinks] [--dirsfirst] [--charset charset]
[--filelimit #] [<directory list>]
-a All files are listed.
-d List directories only.
-l Follow symbolic links like directories.
-f Print the full path prefix for each file.
-i Don't print indentation lines.
-q Print non-printable characters as '?'.
-N Print non-printable characters as is.
-p Print the protections for each file.
-u Displays file owner or UID number.
-g Displays file group owner or GID number.
-s Print the size in bytes of each file.
-h Print the size in a more human readable way.
-D Print the date of last modification.
-F Appends '/', '=', '*', or '|' as per ls -F.
-v Sort files alphanumerically by version.
-r Sort files in reverse alphanumeric order.
-t Sort files by last modification time.
-x Stay on current filesystem only.
-L level Descend only level directories deep.
-A Print ANSI lines graphic indentation lines.
-S Print with ASCII graphics indentation lines.
-n Turn colorization off always (-C overrides).
-C Turn colorization on always.
-P pattern List only those files that match the pattern given.
-I pattern Do not list files that match the given pattern.
-H baseHREF Prints out HTML format with baseHREF as top directory.
-T string Replace the default HTML title and H1 header with string.
-R Rerun tree when max dir level reached.
-o file Output to file instead of stdout.
--inodes Print inode number of each file.
--device Print device ID number to which each file belongs.
--noreport Turn off file/directory count at end of tree listing.
--nolinks Turn off hyperlinks in HTML output.
--dirsfirst List directories before files.
--charset X Use charset X for HTML and indentation line output.
--filelimit # Do not descend dirs with more than # files in them.
Compared to the Windows tree:
> tree /?
Graphically displays the folder structure of a drive or path.
TREE [drive:][path] [/F] [/A]
/F Display the names of the files in each folder.
/A Use ASCII instead of extended characters.
edited Nov 15 '18 at 3:54
answered May 8 '15 at 18:13
Brian Burns
520510
520510
IMO, this is the most straight forward way to get tree cmd in Cygwin and I tried the compilation route before unsuccessfully. With this you just download the binary, extract it to a folder on your cygwins path and violla, tree command out of the box
– iloveretards
Apr 11 '16 at 18:53
in cygwin:apt-cyg install treeandtree.exewill be in the cygwinbinfolder.
– Timo
Oct 26 '17 at 10:03
add a comment |
IMO, this is the most straight forward way to get tree cmd in Cygwin and I tried the compilation route before unsuccessfully. With this you just download the binary, extract it to a folder on your cygwins path and violla, tree command out of the box
– iloveretards
Apr 11 '16 at 18:53
in cygwin:apt-cyg install treeandtree.exewill be in the cygwinbinfolder.
– Timo
Oct 26 '17 at 10:03
IMO, this is the most straight forward way to get tree cmd in Cygwin and I tried the compilation route before unsuccessfully. With this you just download the binary, extract it to a folder on your cygwins path and violla, tree command out of the box
– iloveretards
Apr 11 '16 at 18:53
IMO, this is the most straight forward way to get tree cmd in Cygwin and I tried the compilation route before unsuccessfully. With this you just download the binary, extract it to a folder on your cygwins path and violla, tree command out of the box
– iloveretards
Apr 11 '16 at 18:53
in cygwin:
apt-cyg install tree and tree.exewill be in the cygwin bin folder.– Timo
Oct 26 '17 at 10:03
in cygwin:
apt-cyg install tree and tree.exewill be in the cygwin bin folder.– Timo
Oct 26 '17 at 10:03
add a comment |
There is a tree command in windows already - only problem is it is tree.com and git bash will not automatically add extension .com and execute it.
However it will find it if you press tab after you type tree or tre
To see files you have to use //f - you have to use // or bash will think it is folder name
I also used //a to show ascii lines but you don't have to use it
Example:
dean@dean:~/java$ tree
bash: tree: command not found
dean@dean:~/java$ tree.com //a
Folder PATH listing for volume c
Volume serial number is 4E70-B37A
C:.
+---atom
+---sublime
---vscode
dean@dean:~/java$ tree.com //a //f
Folder PATH listing for volume c
Volume serial number is 4E70-B37A
C:.
+---atom
| test1
|
+---sublime
| test2
|
---vscode
test3
dean@dean:~/java$
awesome, worked like a charm..
– Santosh Kumar A
Oct 20 '18 at 7:13
add a comment |
There is a tree command in windows already - only problem is it is tree.com and git bash will not automatically add extension .com and execute it.
However it will find it if you press tab after you type tree or tre
To see files you have to use //f - you have to use // or bash will think it is folder name
I also used //a to show ascii lines but you don't have to use it
Example:
dean@dean:~/java$ tree
bash: tree: command not found
dean@dean:~/java$ tree.com //a
Folder PATH listing for volume c
Volume serial number is 4E70-B37A
C:.
+---atom
+---sublime
---vscode
dean@dean:~/java$ tree.com //a //f
Folder PATH listing for volume c
Volume serial number is 4E70-B37A
C:.
+---atom
| test1
|
+---sublime
| test2
|
---vscode
test3
dean@dean:~/java$
awesome, worked like a charm..
– Santosh Kumar A
Oct 20 '18 at 7:13
add a comment |
There is a tree command in windows already - only problem is it is tree.com and git bash will not automatically add extension .com and execute it.
However it will find it if you press tab after you type tree or tre
To see files you have to use //f - you have to use // or bash will think it is folder name
I also used //a to show ascii lines but you don't have to use it
Example:
dean@dean:~/java$ tree
bash: tree: command not found
dean@dean:~/java$ tree.com //a
Folder PATH listing for volume c
Volume serial number is 4E70-B37A
C:.
+---atom
+---sublime
---vscode
dean@dean:~/java$ tree.com //a //f
Folder PATH listing for volume c
Volume serial number is 4E70-B37A
C:.
+---atom
| test1
|
+---sublime
| test2
|
---vscode
test3
dean@dean:~/java$
There is a tree command in windows already - only problem is it is tree.com and git bash will not automatically add extension .com and execute it.
However it will find it if you press tab after you type tree or tre
To see files you have to use //f - you have to use // or bash will think it is folder name
I also used //a to show ascii lines but you don't have to use it
Example:
dean@dean:~/java$ tree
bash: tree: command not found
dean@dean:~/java$ tree.com //a
Folder PATH listing for volume c
Volume serial number is 4E70-B37A
C:.
+---atom
+---sublime
---vscode
dean@dean:~/java$ tree.com //a //f
Folder PATH listing for volume c
Volume serial number is 4E70-B37A
C:.
+---atom
| test1
|
+---sublime
| test2
|
---vscode
test3
dean@dean:~/java$
edited Apr 10 '18 at 19:15
answered Apr 10 '18 at 19:03
blur
6113
6113
awesome, worked like a charm..
– Santosh Kumar A
Oct 20 '18 at 7:13
add a comment |
awesome, worked like a charm..
– Santosh Kumar A
Oct 20 '18 at 7:13
awesome, worked like a charm..
– Santosh Kumar A
Oct 20 '18 at 7:13
awesome, worked like a charm..
– Santosh Kumar A
Oct 20 '18 at 7:13
add a comment |
git-bash is really just a cut down version of mingw. Install Cygwin from cygwin.com, and then either use the package manager to install 'tree' or whatever package it's in, or if it doesn't exist, then install gcc, download the tree source from here:
http://mama.indstate.edu/users/ice/tree/
Then follow the instructions in the INSTALL file (make, make install)
So is it impossible in minggw?
– Jen S.
Jan 21 '14 at 9:27
1
I'd imagine it isn't too hard from mingw, but isn't possible from your default git-bash prompt, because I imagine that git-bash doesn't come with tools you need like a C/C++ compiler. But you could try installing mingw, making sure to include gcc, and following the instructions in the tree INSTALL file. I have used mingw to compile things like this on Windows in the past, so this part is definitely possible.
– Jonathan Hartley
Jan 22 '14 at 9:30
add a comment |
git-bash is really just a cut down version of mingw. Install Cygwin from cygwin.com, and then either use the package manager to install 'tree' or whatever package it's in, or if it doesn't exist, then install gcc, download the tree source from here:
http://mama.indstate.edu/users/ice/tree/
Then follow the instructions in the INSTALL file (make, make install)
So is it impossible in minggw?
– Jen S.
Jan 21 '14 at 9:27
1
I'd imagine it isn't too hard from mingw, but isn't possible from your default git-bash prompt, because I imagine that git-bash doesn't come with tools you need like a C/C++ compiler. But you could try installing mingw, making sure to include gcc, and following the instructions in the tree INSTALL file. I have used mingw to compile things like this on Windows in the past, so this part is definitely possible.
– Jonathan Hartley
Jan 22 '14 at 9:30
add a comment |
git-bash is really just a cut down version of mingw. Install Cygwin from cygwin.com, and then either use the package manager to install 'tree' or whatever package it's in, or if it doesn't exist, then install gcc, download the tree source from here:
http://mama.indstate.edu/users/ice/tree/
Then follow the instructions in the INSTALL file (make, make install)
git-bash is really just a cut down version of mingw. Install Cygwin from cygwin.com, and then either use the package manager to install 'tree' or whatever package it's in, or if it doesn't exist, then install gcc, download the tree source from here:
http://mama.indstate.edu/users/ice/tree/
Then follow the instructions in the INSTALL file (make, make install)
answered Jul 23 '13 at 14:45
Jonathan Hartley
623817
623817
So is it impossible in minggw?
– Jen S.
Jan 21 '14 at 9:27
1
I'd imagine it isn't too hard from mingw, but isn't possible from your default git-bash prompt, because I imagine that git-bash doesn't come with tools you need like a C/C++ compiler. But you could try installing mingw, making sure to include gcc, and following the instructions in the tree INSTALL file. I have used mingw to compile things like this on Windows in the past, so this part is definitely possible.
– Jonathan Hartley
Jan 22 '14 at 9:30
add a comment |
So is it impossible in minggw?
– Jen S.
Jan 21 '14 at 9:27
1
I'd imagine it isn't too hard from mingw, but isn't possible from your default git-bash prompt, because I imagine that git-bash doesn't come with tools you need like a C/C++ compiler. But you could try installing mingw, making sure to include gcc, and following the instructions in the tree INSTALL file. I have used mingw to compile things like this on Windows in the past, so this part is definitely possible.
– Jonathan Hartley
Jan 22 '14 at 9:30
So is it impossible in minggw?
– Jen S.
Jan 21 '14 at 9:27
So is it impossible in minggw?
– Jen S.
Jan 21 '14 at 9:27
1
1
I'd imagine it isn't too hard from mingw, but isn't possible from your default git-bash prompt, because I imagine that git-bash doesn't come with tools you need like a C/C++ compiler. But you could try installing mingw, making sure to include gcc, and following the instructions in the tree INSTALL file. I have used mingw to compile things like this on Windows in the past, so this part is definitely possible.
– Jonathan Hartley
Jan 22 '14 at 9:30
I'd imagine it isn't too hard from mingw, but isn't possible from your default git-bash prompt, because I imagine that git-bash doesn't come with tools you need like a C/C++ compiler. But you could try installing mingw, making sure to include gcc, and following the instructions in the tree INSTALL file. I have used mingw to compile things like this on Windows in the past, so this part is definitely possible.
– Jonathan Hartley
Jan 22 '14 at 9:30
add a comment |
You must install the Three for Windows as said above by the link: http://gnuwin32.sourceforge.net/packages/tree.htm
Besides that you need to add the tree program to your windows path or the tree command will be available only on cmd. Access your windows path and add this (for default installation):
;C:Program Files (x86)GnuWin32bin
Them you will be able to use tree command on git bash on windows.
add a comment |
You must install the Three for Windows as said above by the link: http://gnuwin32.sourceforge.net/packages/tree.htm
Besides that you need to add the tree program to your windows path or the tree command will be available only on cmd. Access your windows path and add this (for default installation):
;C:Program Files (x86)GnuWin32bin
Them you will be able to use tree command on git bash on windows.
add a comment |
You must install the Three for Windows as said above by the link: http://gnuwin32.sourceforge.net/packages/tree.htm
Besides that you need to add the tree program to your windows path or the tree command will be available only on cmd. Access your windows path and add this (for default installation):
;C:Program Files (x86)GnuWin32bin
Them you will be able to use tree command on git bash on windows.
You must install the Three for Windows as said above by the link: http://gnuwin32.sourceforge.net/packages/tree.htm
Besides that you need to add the tree program to your windows path or the tree command will be available only on cmd. Access your windows path and add this (for default installation):
;C:Program Files (x86)GnuWin32bin
Them you will be able to use tree command on git bash on windows.
answered Mar 1 '16 at 14:48
Lucas Amorim Silva
1
1
add a comment |
add a comment |
This is the beginning of my .gitconfig file :
I made an alias for log --graph
# This is Git's per-user configuration file.
[user]
# Please adapt and uncomment the following lines:
name = xxxxxx
email = xxx@xxx.xxx
[alias]
tree = log --graph --oneline --all --pretty=format:'%C(yellow)%h%Creset -%Cred%d%Creset %s %Cgreen%cr%Creset %C(cyan)%an%Creset %gn'
Not the solution. The alias shows the commit and not the files / dirs.
– Timo
Oct 26 '17 at 10:01
add a comment |
This is the beginning of my .gitconfig file :
I made an alias for log --graph
# This is Git's per-user configuration file.
[user]
# Please adapt and uncomment the following lines:
name = xxxxxx
email = xxx@xxx.xxx
[alias]
tree = log --graph --oneline --all --pretty=format:'%C(yellow)%h%Creset -%Cred%d%Creset %s %Cgreen%cr%Creset %C(cyan)%an%Creset %gn'
Not the solution. The alias shows the commit and not the files / dirs.
– Timo
Oct 26 '17 at 10:01
add a comment |
This is the beginning of my .gitconfig file :
I made an alias for log --graph
# This is Git's per-user configuration file.
[user]
# Please adapt and uncomment the following lines:
name = xxxxxx
email = xxx@xxx.xxx
[alias]
tree = log --graph --oneline --all --pretty=format:'%C(yellow)%h%Creset -%Cred%d%Creset %s %Cgreen%cr%Creset %C(cyan)%an%Creset %gn'
This is the beginning of my .gitconfig file :
I made an alias for log --graph
# This is Git's per-user configuration file.
[user]
# Please adapt and uncomment the following lines:
name = xxxxxx
email = xxx@xxx.xxx
[alias]
tree = log --graph --oneline --all --pretty=format:'%C(yellow)%h%Creset -%Cred%d%Creset %s %Cgreen%cr%Creset %C(cyan)%an%Creset %gn'
answered Mar 18 '16 at 10:53
Delphine
1
1
Not the solution. The alias shows the commit and not the files / dirs.
– Timo
Oct 26 '17 at 10:01
add a comment |
Not the solution. The alias shows the commit and not the files / dirs.
– Timo
Oct 26 '17 at 10:01
Not the solution. The alias shows the commit and not the files / dirs.
– Timo
Oct 26 '17 at 10:01
Not the solution. The alias shows the commit and not the files / dirs.
– Timo
Oct 26 '17 at 10:01
add a comment |
Git for Windows (https://gitforwindows.org/) (has Git Bash) but it does not include tree. tree is available for via pacman (Package Manager) but that is only available if you install "Git for Windows SDK" (scroll to the bottom of gitforwindows.org/ which provides a link to download installer for it from https://github.com/git-for-windows/build-extra/releases/latest)
This SO: "Package management in git for windows?" was very helpful
https://stackoverflow.com/questions/32712133/package-management-in-git-for-windows
Also as commented in the above SO, they link to this git for windows issue [Pacman missing on fresh 2.5.2 install #397] that it was intended to not include pacman in the default install.
Anyways, I installed "Git for Windows SDK", then in it's bash prompt (SDK-64) I ran the
following to install current tree v1.7.0-1 (as of this posting Aug 30, 2018):
[SDK-64: Bash Terminal for Git for Windows SDK]
pacman -S tree
...
Proceed with installation? [Y/n] Y
On my system, Git for Windows SDK is installed under: C:git-sdk-64, so from my Git for Windows Bash shell (that did not have tree installed), I copied it over tree.exe to it's /usr/bin directory, e.g.
[MINGW64: Bash Terminal for Git for Windows]
cd /usr/bin
cp /c/git-sdk-64/usr/bin/tree.exe .
Now I can run tree v1.7.0 from both Git Bash shells.
So, to make it even easier for others and maybe myself on a future machine, I looked at where pacman was getting the tree package from by running following in my Git for Windows SDK Bash terminal:
$ pacman -S --info tree
Repository : msys
Name : tree
Version : 1.7.0-1
Description : A directory listing program displaying a depth indented list of files
Architecture : x86_64
...
The key thing, here is that pacman is getting it from the "msys" repository (FYI: even though it says msys, it really is using msys2), so I looked at /etc/pacman.d/mirrorlist.msys and the first mirror points to http://repo.msys2.org/msys/$arch/
So next time you want a package that is NOT in Git for Windows, you can download them from: http://repo.msys2.org/msys/x86_64/ (for 64-bit) or from http://repo.msys2.org/msys/i686/ (32-bit)
e.g. direct download link for tree v1.7.0-1
- 64-bit: http://repo.msys2.org/msys/x86_64/tree-1.7.0-1-x86_64.pkg.tar.xz
- or https://sourceforge.net/projects/msys2/files/REPOS/MSYS2/x86_64/tree-1.7.0-1-x86_64.pkg.tar.xz
- 32-bit: http://repo.msys2.org/msys/i686/tree-1.7.0-1-i686.pkg.tar.xz
- or https://sourceforge.net/projects/msys2/files/REPOS/MSYS2/i686/tree-1.7.0-1-i686.pkg.tar.xz
1
FYI: Git SCM's Window's download at git-scm.com/download pulls the latest from Git for Windows GitHub (github.com/git-for-windows/git/releases) from github.com/git-for-windows/git
– N. Ngo
Aug 30 '18 at 20:58
add a comment |
Git for Windows (https://gitforwindows.org/) (has Git Bash) but it does not include tree. tree is available for via pacman (Package Manager) but that is only available if you install "Git for Windows SDK" (scroll to the bottom of gitforwindows.org/ which provides a link to download installer for it from https://github.com/git-for-windows/build-extra/releases/latest)
This SO: "Package management in git for windows?" was very helpful
https://stackoverflow.com/questions/32712133/package-management-in-git-for-windows
Also as commented in the above SO, they link to this git for windows issue [Pacman missing on fresh 2.5.2 install #397] that it was intended to not include pacman in the default install.
Anyways, I installed "Git for Windows SDK", then in it's bash prompt (SDK-64) I ran the
following to install current tree v1.7.0-1 (as of this posting Aug 30, 2018):
[SDK-64: Bash Terminal for Git for Windows SDK]
pacman -S tree
...
Proceed with installation? [Y/n] Y
On my system, Git for Windows SDK is installed under: C:git-sdk-64, so from my Git for Windows Bash shell (that did not have tree installed), I copied it over tree.exe to it's /usr/bin directory, e.g.
[MINGW64: Bash Terminal for Git for Windows]
cd /usr/bin
cp /c/git-sdk-64/usr/bin/tree.exe .
Now I can run tree v1.7.0 from both Git Bash shells.
So, to make it even easier for others and maybe myself on a future machine, I looked at where pacman was getting the tree package from by running following in my Git for Windows SDK Bash terminal:
$ pacman -S --info tree
Repository : msys
Name : tree
Version : 1.7.0-1
Description : A directory listing program displaying a depth indented list of files
Architecture : x86_64
...
The key thing, here is that pacman is getting it from the "msys" repository (FYI: even though it says msys, it really is using msys2), so I looked at /etc/pacman.d/mirrorlist.msys and the first mirror points to http://repo.msys2.org/msys/$arch/
So next time you want a package that is NOT in Git for Windows, you can download them from: http://repo.msys2.org/msys/x86_64/ (for 64-bit) or from http://repo.msys2.org/msys/i686/ (32-bit)
e.g. direct download link for tree v1.7.0-1
- 64-bit: http://repo.msys2.org/msys/x86_64/tree-1.7.0-1-x86_64.pkg.tar.xz
- or https://sourceforge.net/projects/msys2/files/REPOS/MSYS2/x86_64/tree-1.7.0-1-x86_64.pkg.tar.xz
- 32-bit: http://repo.msys2.org/msys/i686/tree-1.7.0-1-i686.pkg.tar.xz
- or https://sourceforge.net/projects/msys2/files/REPOS/MSYS2/i686/tree-1.7.0-1-i686.pkg.tar.xz
1
FYI: Git SCM's Window's download at git-scm.com/download pulls the latest from Git for Windows GitHub (github.com/git-for-windows/git/releases) from github.com/git-for-windows/git
– N. Ngo
Aug 30 '18 at 20:58
add a comment |
Git for Windows (https://gitforwindows.org/) (has Git Bash) but it does not include tree. tree is available for via pacman (Package Manager) but that is only available if you install "Git for Windows SDK" (scroll to the bottom of gitforwindows.org/ which provides a link to download installer for it from https://github.com/git-for-windows/build-extra/releases/latest)
This SO: "Package management in git for windows?" was very helpful
https://stackoverflow.com/questions/32712133/package-management-in-git-for-windows
Also as commented in the above SO, they link to this git for windows issue [Pacman missing on fresh 2.5.2 install #397] that it was intended to not include pacman in the default install.
Anyways, I installed "Git for Windows SDK", then in it's bash prompt (SDK-64) I ran the
following to install current tree v1.7.0-1 (as of this posting Aug 30, 2018):
[SDK-64: Bash Terminal for Git for Windows SDK]
pacman -S tree
...
Proceed with installation? [Y/n] Y
On my system, Git for Windows SDK is installed under: C:git-sdk-64, so from my Git for Windows Bash shell (that did not have tree installed), I copied it over tree.exe to it's /usr/bin directory, e.g.
[MINGW64: Bash Terminal for Git for Windows]
cd /usr/bin
cp /c/git-sdk-64/usr/bin/tree.exe .
Now I can run tree v1.7.0 from both Git Bash shells.
So, to make it even easier for others and maybe myself on a future machine, I looked at where pacman was getting the tree package from by running following in my Git for Windows SDK Bash terminal:
$ pacman -S --info tree
Repository : msys
Name : tree
Version : 1.7.0-1
Description : A directory listing program displaying a depth indented list of files
Architecture : x86_64
...
The key thing, here is that pacman is getting it from the "msys" repository (FYI: even though it says msys, it really is using msys2), so I looked at /etc/pacman.d/mirrorlist.msys and the first mirror points to http://repo.msys2.org/msys/$arch/
So next time you want a package that is NOT in Git for Windows, you can download them from: http://repo.msys2.org/msys/x86_64/ (for 64-bit) or from http://repo.msys2.org/msys/i686/ (32-bit)
e.g. direct download link for tree v1.7.0-1
- 64-bit: http://repo.msys2.org/msys/x86_64/tree-1.7.0-1-x86_64.pkg.tar.xz
- or https://sourceforge.net/projects/msys2/files/REPOS/MSYS2/x86_64/tree-1.7.0-1-x86_64.pkg.tar.xz
- 32-bit: http://repo.msys2.org/msys/i686/tree-1.7.0-1-i686.pkg.tar.xz
- or https://sourceforge.net/projects/msys2/files/REPOS/MSYS2/i686/tree-1.7.0-1-i686.pkg.tar.xz
Git for Windows (https://gitforwindows.org/) (has Git Bash) but it does not include tree. tree is available for via pacman (Package Manager) but that is only available if you install "Git for Windows SDK" (scroll to the bottom of gitforwindows.org/ which provides a link to download installer for it from https://github.com/git-for-windows/build-extra/releases/latest)
This SO: "Package management in git for windows?" was very helpful
https://stackoverflow.com/questions/32712133/package-management-in-git-for-windows
Also as commented in the above SO, they link to this git for windows issue [Pacman missing on fresh 2.5.2 install #397] that it was intended to not include pacman in the default install.
Anyways, I installed "Git for Windows SDK", then in it's bash prompt (SDK-64) I ran the
following to install current tree v1.7.0-1 (as of this posting Aug 30, 2018):
[SDK-64: Bash Terminal for Git for Windows SDK]
pacman -S tree
...
Proceed with installation? [Y/n] Y
On my system, Git for Windows SDK is installed under: C:git-sdk-64, so from my Git for Windows Bash shell (that did not have tree installed), I copied it over tree.exe to it's /usr/bin directory, e.g.
[MINGW64: Bash Terminal for Git for Windows]
cd /usr/bin
cp /c/git-sdk-64/usr/bin/tree.exe .
Now I can run tree v1.7.0 from both Git Bash shells.
So, to make it even easier for others and maybe myself on a future machine, I looked at where pacman was getting the tree package from by running following in my Git for Windows SDK Bash terminal:
$ pacman -S --info tree
Repository : msys
Name : tree
Version : 1.7.0-1
Description : A directory listing program displaying a depth indented list of files
Architecture : x86_64
...
The key thing, here is that pacman is getting it from the "msys" repository (FYI: even though it says msys, it really is using msys2), so I looked at /etc/pacman.d/mirrorlist.msys and the first mirror points to http://repo.msys2.org/msys/$arch/
So next time you want a package that is NOT in Git for Windows, you can download them from: http://repo.msys2.org/msys/x86_64/ (for 64-bit) or from http://repo.msys2.org/msys/i686/ (32-bit)
e.g. direct download link for tree v1.7.0-1
- 64-bit: http://repo.msys2.org/msys/x86_64/tree-1.7.0-1-x86_64.pkg.tar.xz
- or https://sourceforge.net/projects/msys2/files/REPOS/MSYS2/x86_64/tree-1.7.0-1-x86_64.pkg.tar.xz
- 32-bit: http://repo.msys2.org/msys/i686/tree-1.7.0-1-i686.pkg.tar.xz
- or https://sourceforge.net/projects/msys2/files/REPOS/MSYS2/i686/tree-1.7.0-1-i686.pkg.tar.xz
answered Aug 30 '18 at 20:54
N. Ngo
13
13
1
FYI: Git SCM's Window's download at git-scm.com/download pulls the latest from Git for Windows GitHub (github.com/git-for-windows/git/releases) from github.com/git-for-windows/git
– N. Ngo
Aug 30 '18 at 20:58
add a comment |
1
FYI: Git SCM's Window's download at git-scm.com/download pulls the latest from Git for Windows GitHub (github.com/git-for-windows/git/releases) from github.com/git-for-windows/git
– N. Ngo
Aug 30 '18 at 20:58
1
1
FYI: Git SCM's Window's download at git-scm.com/download pulls the latest from Git for Windows GitHub (github.com/git-for-windows/git/releases) from github.com/git-for-windows/git
– N. Ngo
Aug 30 '18 at 20:58
FYI: Git SCM's Window's download at git-scm.com/download pulls the latest from Git for Windows GitHub (github.com/git-for-windows/git/releases) from github.com/git-for-windows/git
– N. Ngo
Aug 30 '18 at 20:58
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f531592%2fhow-do-i-add-the-tree-command-to-git-bash-on-windows%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
git-bashis really just a cut down version of Cygwin. Best way to go is install Cygwin from cygwin.com, and use the package manager there to installtreeor whatever package it's in (if it exists).– allquixotic
Jan 14 '13 at 16:35
2
@allquixotic actually these days it's mingw
– jcollum
Jan 14 '13 at 16:47