How to get the type and size of the git object using one single command?
Separately I can get type using
git cat-file -t and size using
git cat-file -s.
At the same type I can get type and size of all objects inside the tree just using
git ls-tree -l.
- Git checkout a subdirectory without having the full repo locally
- Install java on linux server programmatically
- Git checkout without committing
- Git Extensions doesn't show up in VS 2010 Professional
- Using git for the first time
- Cloned directly from repo…get error when pushing
But how can I properly get those for one single object using one single command?
One Solution collect form web for “How to get the type and size of the git object using one single command?”
There is probably no way of doing it on git, but you can do a little shell magic.
git cat-file -t master ; git cat-file -s master will work but will output in two lines.
If you want it on one line:
(git cat-file -t master ; git cat-file -s master) | paste -sd " "