git配置

来源:互联网 发布:oracle恢复原来的数据 编辑:程序博客网 时间:2024/06/03 14:11

1.https://github.com/上注册一个用户,新建一个项目,这个很简单,新建成功后在account > Your profile 中可以看到Repositories 1,表示新建成功

2.https://git-for-windows.github.io/可下载客户端,并安装,安装注意的事项也不多,百度一拉一大把

3.需要配置开发工具中的Terminal中配置工作目录,及shell path为:${git path}\git-cmd.exe,配置git中path为${git path}\git-cmd.exe,配置github中host为:https://github.com,Auth Type若选择为password的话,需要填写在github上注册的用户密码

4.生成密钥,用${git path}\git-bash.exe来执行:ssh-keygen -t rsa,一路回车,会有提示:Your public key has been saved in ${file},这个就是你生成的公钥,找到这个文件,打开复制其内容

5.到github上account > Settings >SSH and GPG keys > New SSH key :粘贴上一步复制的密钥,取一个title,add SSH key

6.开发工具的Terminal中直接执行git命令(第3步配置好的话应该是没有问题的):

git init 

git add youfile*(增加要提交到git的文件)

git commit -m "first commit"        

git remote add origin https://********.git (****中省略的是你创建项目的git地址)

git push origin master 


配置用户及邮箱:

git config --global user.name "XXX"

git config --global user.email "XXX@XXX.com"


原创粉丝点击