當前位置:首頁 » 密碼管理 » git怎麼設置密碼

git怎麼設置密碼

發布時間: 2023-06-11 15:20:13

㈠ Git伺服器里如何為各個開發者設置用戶名和密碼呢在線等待回復

git協作開發,不是以用戶名和密碼的方式.
根據git所使用的協議,如果是ssh 那麼方式就應該為 [email protected]:xxxxxx.git的方式,如果是這樣,那麼配置了公鑰那麼就可以直接訪問了,不需要用戶名和密碼,如果是http/https的方式,那麼驗證的就是你登陸的用戶名和密碼,著名的gitlab 可以同時使用這兩種方式,不需要你親自去配置 ,詳見 :http://about.gitlab.com

sharyuke

㈡ git的密碼怎麼設置

設置git用戶名/郵箱
git config --global user.name [username]
git config --global user.email [email]

㈢ 怎樣連接git遠程倉庫,設置用戶名和密碼

當使用HTTPS協議推送代碼到Git倉庫時,發現每次都需要輸入密碼,操作起來非常麻煩。下面介紹幾種免去輸入密碼的方法。
HTTPS協議推送
使用HTTPS協議,有一種簡單粗暴的方式是在遠程地址中帶上密碼。
> git remote set-url origin http://yourname:[email protected]/yourname/project.git

還有一種方法,是創建文件存儲Git用戶名和密碼。
以Windows環境為例,在%USERPROFILE%目錄中(一般為C:\Users\yourname),打開Git Bash命令行,創建文件
> touch .git-credentials

在文件中輸入倉庫域名,這里使用了bitbucket.org。
https://yourname:[email protected]

在CMD終端中設置在全局Git環境中,長期存儲密碼
> git config --global credential.helper store

其他設置密碼方式
記住密碼(默認15分鍾):git config --global credential.helper cache
自定義存儲時間:git config credential.helper 'cache --timeout=3600'
SSH協議推送
如果原來的推送地址協議是HTTPS,可以通過換成SSH協議,在遠程倉庫添加SSH Key來實現推送時免賬戶密碼輸入。
> git remote -v // 查看遠程地址
> git remote rm origin // 刪除原有的推送地址
> git remote add origin [email protected]:<用戶名>/版本庫名

或者
> git remote -v
> git remote set-url origin [email protected]:<用戶名>/版本庫名

執行推送。
> git push -u origin master

發現提示許可權不夠。
The authenticity of host 'bitbucket.org (104.192.143.1)' can't be established.
RSA key fingerprint is SHA256:.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'bitbucket.org,104.192.143.1' (RSA) to the list of kn
own hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

需要在本地創建該帳號的RSA Key。可以參考以下兩篇文章:
Windows下配置SSH連接Github
Git如何在本地生成多個SSH key
然後再執行推送。
> git push -u origin master

就可以推送成功了。

㈣ git如何設置賬號密碼從而每次項目中的組員更新或者提交代碼的時候都需要輸入賬號和密碼呢

插入如下代碼使項目中的組員每次修改數據都要輸入賬號和密碼:

  • gitconfig--globaluser.name[username]

  • gitconfig--globaluser.password[userpassword]

PS:想要保存密碼,則需要插入如下代碼:git config –global credential.helper store。

熱點內容
隨機啟動腳本 發布:2025-07-05 16:10:30 瀏覽:515
微博資料庫設計 發布:2025-07-05 15:30:55 瀏覽:19
linux485 發布:2025-07-05 14:38:28 瀏覽:299
php用的軟體 發布:2025-07-05 14:06:22 瀏覽:748
沒有許可權訪問計算機 發布:2025-07-05 13:29:11 瀏覽:423
javaweb開發教程視頻教程 發布:2025-07-05 13:24:41 瀏覽:682
康師傅控流腳本破解 發布:2025-07-05 13:17:27 瀏覽:232
java的開發流程 發布:2025-07-05 12:45:11 瀏覽:676
怎麼看內存卡配置 發布:2025-07-05 12:29:19 瀏覽:275
訪問學者英文個人簡歷 發布:2025-07-05 12:29:17 瀏覽:825