簡體   English   中英

使用Shell腳本的Git命令

[英]Git command using shell script

我已經為git push設置了命令。

commit_message =“ aaaa”

git add .

git commit -m "commit_message"

git push origin master

但是每次我必須為此設置用戶名和密碼。

任何人都可以幫助我創建腳本而無需輸入用戶名和密碼,例如如何在該shellscript文件中感覺自動用戶名和密碼。

您應該使用ssh clone存儲庫。 通過ssh克隆存儲庫后。 它不會要求輸入密碼。

請添加git remote set-url origin git@host_name:user_name/repo.git

如果在遠程URL中使用http(s?)://協議,則可以將其修改為:

git remote set-url https://my_git_username:my_super_secret_password@git_server/repo.git

暫無
暫無

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

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