git配置
- 在gitdir中新建lsf个人目录
mkdir lsf - 检出代码
git clone ssh://git@cms.xxx.com:xxxxxx/xxx/xxxxxx.git - 进入代码目录
cd xxxxxx - 配置个人账户和邮箱
必须在代码目录下配置,其它目录下显示的信息是全局配置:
git config user.name xxxxxx
git config user.email xxxxxx@xxxxxx.com
查看配置的是否正确:
git config user.name
git config user.email
或者在文件“本地仓库目录/.git/config”中查看 - 修改和提交
git add . 或 git add xxx
git commit -m “Rxxx lsfadd”
git pull --rebase
git push origin develop:develop
windows下检出代码
- git下配置用户名和邮箱
windows下因为就自己用,配置成全局的就行,用–global参数
git config --global user.name xxxxxx
git config --global user.email xxxxxx@cebbank.com - windows下检出代码
windows下检出代码需要生成秘钥,并在CMS上的公钥配置中配置生成的公钥数据。
windows打开命令行,执行:
ssh-keygen -t rsa -C "xxxxxx@xxxxxx.com"
执行上述命令后,会在C:/Users/admin/.ssh目录下生成id_rsa和id_rsa.pub
在gitee或其他代码管理平台中,右上角头像-基本信息-SSH公钥配置-添加公钥,将id_rsa.pub中的数据拷贝到公钥输入框,公钥标题会自动生成。
此时,在windows下执行git clone就可以正常检出代码。