當前位置:首頁 » 密碼管理 » 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-09-18 02:07:26 瀏覽:930
python不支持的數據類型有 發布:2025-09-18 01:50:23 瀏覽:643
長江存儲科技招聘 發布:2025-09-18 01:44:48 瀏覽:767
斯維爾加密狗 發布:2025-09-18 01:31:00 瀏覽:252
手把手win7搭建web伺服器 發布:2025-09-18 01:25:53 瀏覽:730
硬碟緩存128m 發布:2025-09-18 01:15:13 瀏覽:757
蘋果手機設備密碼是指什麼 發布:2025-09-18 01:02:26 瀏覽:470
asp門戶網站源碼 發布:2025-09-18 00:54:00 瀏覽:453
java資料庫例子 發布:2025-09-18 00:53:58 瀏覽:223
sh腳本輸出 發布:2025-09-18 00:48:10 瀏覽:262