![](/img/trans.png)
[英]How to push both the client side and server side project folders together as a one project (api + front end) on github?
[英]How to push code using Github API?
我想通過 nodejs 應用程序將目錄推送到 Github。 這是我目前所做的。 我從用戶那里獲取用戶名、密碼和新的存儲庫名稱。 然后,我通過 Github API( https://developer.github.com/v3/repos/#create )創建新的存儲庫。 現在我想將一些特定的代碼推送到這個存儲庫。 我不能使用 node.js 子進程(git push origin master),因為這需要用戶名和密碼。 如何通過 API 將代碼推送到 Github。 (如果通過命令行,則無需手動輸入密碼)
要在每次提交時跳過密碼,您需要告訴 git 將憑據存儲在單獨的位置。 這可以通過使用以下命令來完成:
git config --global credential.helper cache
這會將密碼存儲15 分鍾。 如果您願意,可以通過以毫秒為單位指定持續時間來延長此時間:
git config --global credential.helper "cache --timeout=3600"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.