git 的基本命令操作

北战南征 提交于 2019-11-30 09:28:10

1. 打开命名窗口: 右键选择“Git Bash Here”;

2. 将github上的仓库克隆到本地: git clone "github repository  url ";

 

 将本地的文件都提交到github上去:

1. 初始化: git init

2. 上传所有本地文件: git add . (如果想上次某个具体的文件,只需要将“.”,改为文件名)

3. 将add的文件commit到仓库: git commit -m "注释,提交了什么东西"

4. 去github上创建自己的Repository,(注意不要勾选“initialize this repository with a readme”)。创建好后,复制"clone URL"中github repository地址。

5. 将本地仓库关联到github上: git remote add origin https://github.com/testurl/test.git

6. 在上传前pull一下: git pull origin master

7. 提交前要输入username和password.

  git config --global user.name "your username"

  git config --global user.email "your email"

  查看username和email是否配置成功,可以这样查看:

  git config --global user.name

  git config --global user.email

8. 最后一步,上传代码到github上去: git push -u origin master

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!