Git安装配置

来源:互联网 发布:电脑群控软件 编辑:程序博客网 时间:2024/06/06 01:43

1.安装git客户端

2.配置git信息(git.bash)
$ git config –global user.name “提交显示的姓名”

$ git config –global user.email youremail@example.com

$ ssh-keygen -t rsa -C “youremail@example.com”

3.找到你的ssh key
cd /.ssh cat id_rsa.pub
然后copy下来 复制到你的github上 的 SSH and GPG keys 生成你的公钥

4.把自己的项目推到github上
- git init (项目根路径下, 生成一个.git文件,负责该目录下的文件操作)
- 在github 上创建一个仓库来存储你的项目(并复制其ssh的url)

5.设置你要push的远程仓库
$ git remote add origin +上文的url
git push -u origin master(第一次提交需要这样)
此时你就可以1.git add -A 2.git commit -m”msg” 3.git push等等

6.在IDE中配置git(pycharm为例)

  1. 在settings中找到 Version Control
  2. 添加你的项目根目录到Directory(右侧有”+”) VCS选择git即可
原创粉丝点击