0

I want to create a new file that contains the names of all the files that have been changed in a repository PRIOR to commit using batch, so I tried typing in:

git status --porcelain>test.txt

which it outputs the staged/unstaged/untracked files in the test.txt, but I want a way to parse it. What I currently get in test.txt is:

M test1.txt?? newfile.txt

which is hard to parse using batch as they are on the same line for some reason.

The desired end result is :

test1.txt
newfile.txt

or if its possible just have

M test1.txt
?? newfile.txt

being on separate lines would be easier to parse. I am currently only able to use batch and not anything else:(

TL,DR: Get files names in repository that are staged for commit using batch programming and store them in another file

Michel Jiang
  • 341
  • 3
  • 10
  • 2
    They are already in the format you wrote at the end, you are just using the wrong tool to view the file. bash will output only LF as line ending and not CRLF, and Notepad doesn't support that. You should be fine viewing the file in tools like Notepad++ or Sublime Text though. – CherryDT May 04 '16 at 15:55
  • Omg you are right, I dont quite understand the difference between LF and CRLF, but I'll read into it, thanks alot :) – Michel Jiang May 04 '16 at 19:35

0 Answers0