as opposed to the long relative path?
The git status command displays the state of the working directory and the staging area. It lets you see which changes have been staged, which haven't, and which files aren't being tracked by Git. Status output does not show you any information regarding the committed project history.
To check the status, open the git bash, and run the status command on your desired directory. It will run as follows: $ git status.
It seems you have created a repo for too many folders. Make sure you create a new repo ( git init , git clone ) only in your project folder. Now everything in this folder will by tracked by git (unless you use . gitignore).
The output of git status --porcelain
, designed to be easy to parse in a script, outputs the full paths rather than relative paths regardless of where your current directory is within the tree.
Each line output by git status --porcelain
has two leading characters indicating the status of the file (e.g. whether it's untracked, modified, new, deleted, etc.) followed by a space, so if you just want the full paths of everything that would be mentioned in the output of git status
you can do:
git status --porcelain | sed s/^...//
I think cut
is good for this.
git status -s | cut -c4-
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With