如何在单独的行上打印Bash数组的数组元素?这个有效,但肯定有更好的方法:
$ my_array=(one two three)
$ for i in ${my_array[@]}; do echo $i; done
one
two
three
Run Code Online (Sandbox Code Playgroud)
试过这个,但它不起作用:
$ IFS=$'\n' echo ${my_array[*]}
one two three
Run Code Online (Sandbox Code Playgroud) 如何恢复/删除在旧的多文件提交中所做的更改,但仅在单个文件中进行?即类似的东西
git revert <commit-specifier> <file>
exceptgit revert
不接受<file>
参数。以下答案均未解决此问题:
Git:恢复单个文件上的旧提交而是关于如何调试冲突。
撤消 Git 中已推送到远程存储库的特定提交并不能解决我的单个文件问题。
Git:恢复较旧的提交也不能解决单个文件问题。