当前位置:首页 » 密码管理 » 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 15:31:02 浏览:438
php筛选功能 发布:2025-02-05 15:29:09 浏览:166
ip匹配服务器 发布:2025-02-05 15:10:35 浏览:909
php语法后 发布:2025-02-05 15:10:34 浏览:59
oppor9s怎么压缩文件 发布:2025-02-05 15:00:34 浏览:639
苹果耳塞怎么改安卓也能用 发布:2025-02-05 14:50:54 浏览:558
安卓如何鉴别手机真假 发布:2025-02-05 14:28:15 浏览:121
ffmpeglinux编译 发布:2025-02-05 14:28:04 浏览:545
服务器如何做界面 发布:2025-02-05 14:27:23 浏览:291
访问学者单位推荐意见 发布:2025-02-05 14:13:05 浏览:854