當前位置:首頁 » 密碼管理 » 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-02-05 17:45:24 瀏覽:917
3nvm伺服器怎麼搭建 發布:2025-02-05 17:43:52 瀏覽:660
cocosandroid開發 發布:2025-02-05 17:22:17 瀏覽:668
編程員發型 發布:2025-02-05 17:09:18 瀏覽:225
網站會員管理源碼 發布:2025-02-05 17:03:32 瀏覽:193
伺服器埠怎麼調節 發布:2025-02-05 16:57:41 瀏覽:46
樂山海棠社區民意上傳 發布:2025-02-05 16:55:52 瀏覽:510
編程老爺爺 發布:2025-02-05 16:48:20 瀏覽:129
支持ftp的免費空間 發布:2025-02-05 16:32:00 瀏覽:891
python時間比較 發布:2025-02-05 16:31:46 瀏覽:52