git 的基本命令操作

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

猜你喜欢

转载自www.cnblogs.com/irisWhq/p/11576495.html