git 常用命令

一:常用的上传github上的命令行:

…or create a new repository on the command line

1
git init 2 git add README.md 3 git commit -m "first commit" 4 git remote add origin git@github.com:zhongqiulan/test.git 5 git push -u origin master

  …or create a new repository on the command line

2 
3 git remote add origin git@github.com:zhongqiulan/test.git
4 git push -u origin master

二:github上托管静态页面

首先需要在github中创建一个仓库,建议在描述中写上自己的项目访问的地址:https://用户名.github.io/仓库名/文件名 如https://zhongqiulan.github.io/XiaoMi_Program/index.html

git branch gh-pages

git checkout gh-pages

git push origin gh-pages

三:记录常见的bug:

1.首次git clone github中其他人的项目时,我们需要把文件里面的.git文件夹删掉。

2.https://www.jianshu.com/p/12badb7e6c10

原文地址:https://www.cnblogs.com/DZzzz/p/8635649.html