簡體   English   中英

將換行符添加到 git diff --name-only

[英]Add line break to git diff --name-only

name-only 並將輸出保存到文件中。 但更改后的文件名在同一行。 我可以在一行中輸入一個更改后的文件名嗎

git diff HEAD~3 --name-only > ../name.txt

示例輸出:

a.jsb.jsc.js

預期的

a.js
b.js
c.js

我正在使用 Windows 10 操作系統和 CMD

core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
diff.astextplain.textconv=astextplain
rebase.autosquash=true
credential.helper=manager
difftool.usebuiltin=true
gui.recentrepo=C:/My Data/Frontend Development/my projects/ain
gui.recentrepo=C:/NovCR
alias.gl=git
core.autocrlf=true
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
svn-remote.svn.url=https://abcd.ko.com/svn/a/b
svn-remote.svn.fetch=:refs/remotes/git-svn

這是 CRLF 與 LF 行尾問題。 在記事本中打開 git diff 重定向輸出文件時遇到了同樣的問題(需要 CRLF 顯示在新行上)。 當我在 Notepad++ 中打開輸出時,它位於不同的行上(Notepad++ 可以讀取/顯示 unix 樣式換行格式的文件)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM