使用github问题

Posted threestoneslee

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用github问题相关的知识,希望对你有一定的参考价值。

在github上面创建完仓库,推送代码的时候,出错了,报错如下:

.           

 

网上搜索了下,是因为远程repository和我本地的repositor技术分享图片

 

y冲突导致的,而我在创建版本库后,在github的版本库页面点击了创建README.md文件的按钮创建了说明文档,但是却没有pull到本地。这样就产生了版本冲突的问题。

有如下几种解决方法:

1.使用强制push的方法:

$ git push -uorigin master -f

这样会使远程修改丢失,一般是不可取的,尤其是多人协作开发的时候。

2.push前先将远程repository修改pull下来

$ git pull--rebase  origin master

$ git push -uorigin master

3.若不想merge远程和本地修改,可以先创建新的分支:

$ git branch[name]

然后push

$ git push -uorigin [name]

我采用的第二种方式,先pull到本地放自己本地的代码和github上面一样,然后,再push代码到github。

 

技术分享图片

 

 

 

Cause

This is caused by the repository still being empty. There are no commits in the repository and thus no master branch to push to the server.

Resolution

Create the first commit inside of the repository and then it can be pushed. For example, the following with create an initial commit and push it to the server.

touch initial
 
git add initial
 
git commit -m "initial commit"
 
git push -u origin master

github上传教程:https://blog.csdn.net/chenyufeng1991/article/details/48930471

以上是关于使用github问题的主要内容,如果未能解决你的问题,请参考以下文章

VIM 代码片段插件 ultisnips 使用教程

精心收集的 48 个 JavaScript 代码片段,仅需 30 秒就可理解

如何修复空白片段?

latex在vim中的代码片段

如何在片段中获取rootview?

csharp C#代码片段 - 使类成为Singleton模式。 (C#4.0+)https://heiswayi.github.io/2016/simple-singleton-pattern-us