當前位置:首頁 » 密碼管理 » 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-03-17 13:36:59 瀏覽:438
三星手機簡訊在那個文件夾 發布:2025-03-17 13:31:51 瀏覽:194
安卓皇帝隱藏劇情在哪裡 發布:2025-03-17 13:18:53 瀏覽:507
新版安卓為什麼不兼容 發布:2025-03-17 13:18:49 瀏覽:483
s3哪個配置性價比高 發布:2025-03-17 13:06:09 瀏覽:320
氣體壓縮能量 發布:2025-03-17 13:00:16 瀏覽:78
壓縮油19 發布:2025-03-17 12:25:29 瀏覽:858
linux上網代理 發布:2025-03-17 12:23:56 瀏覽:361
c是高級語言嗎 發布:2025-03-17 12:16:31 瀏覽:525
python泛型 發布:2025-03-17 12:15:01 瀏覽:484