fly

git 搭建测试页面

步骤一:

步骤二:

步骤三:

备注:首次同步到github需要添加-u参数,或者先pull下

容易遇到的问题


   error:failed to push some refs to ...

   Dealing with “non-fast-forward” errors
   From time to time you may encounter this error while pushing:

   $ git push origin master  
   To ../remote/  
   ! [rejected]        master -> master (non-fast forward)  
   error: failed to push some refs to '../remote/'  
   To prevent you from losing history, non-fast-forward updates were rejected
   Merge the remote changes before pushing again.  See the 'non-fast forward'
   section of 'git push --help' for details.

这个问题github上面的代码里面已经有你本地新添加的代码文件内容,他不允许直接覆盖

解决方法:
# git pull origin master
重新拉去一次,然后重新提交

如何删除github上不想要或者上传错的文件:

# git rm --cached filename
# git commit -m "hehe"
# git push origin

刷新页面即可消失