[英]iterate through two external file list and execute commands in bash script
[英]execute git commands through bash script in other directory
有沒有辦法在bash腳本中執行git命令,添加更改的文件,用注釋提交它然后將它們推送到bash文件不在存儲庫目錄中的服務器?
這就是我所擁有的,除了提交之外,一切正常,
cd /home/repos
git add file.txt
echo "comment: "
read input_varible
git commit -m '$input_varible'
git push origin master
當提交行執行時,我收到此錯誤,
error: bad index file sha1 signature
fatal: index file corrupt
但是當我在終端中做所有事情時它工作正常。
是的,我試圖通過使用此命令重置索引,但它不起作用
rm -f .git/index
git reset
如果有幫助的話,我正在開發一個linux
是的,這是可能的。 我是通過在~/.bash_profile
文件中為腳本添加別名來實現的。
由於您要添加別名,請不要忘記重新加載終端。 哦,是的,你不需要所有的cd /path/to/directory
東西,因為你需要在存儲庫目錄中啟動你的命令。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.