我可以 git push 另一个目录吗?

Beh*_*joo 4 git

我想编写一个批处理文件来运行git addgit commitgit push在我的机器上的一堆存储库上运行,这样我就不必每次都手动执行。git 命令有目录路径参数吗?

Joa*_*uer 8

通用选项-C指定要git视为当前目录的目录:

git -C ~/myGit commit -m "great commit message"

实际上相当于

cd ~/myGit ; git commit -m "great commit message"

只是它实际上并没有更改当前 shell 中的当前目录。