【问题标题】:How to upload my files in github repository with command?如何使用命令将我的文件上传到 github 存储库中?
【发布时间】:2016-04-17 10:04:16
【问题描述】:

我创建了一个名为 amarjobs 的存储库。

现在没有文件。
我想在此存储库中上传我的工作文件。
我已经做了一些步骤:

 git init
 git remote add origin url
 git pull 
 git push origin master

但它会引发错误。我是 git 的初学者。
我已经搜索过,但我的问题没有得到满意的答案。
谁能解决我的问题?

错误:

谢谢。

【问题讨论】:

标签: git laravel github


【解决方案1】:

您无法推送,因为远程分支中有您没有的更改。
你可以在推送前简单地执行git pull,它会解决这个问题。


按照这些步骤,您将能够将您的代码推送到 github:

# Create a git repository in the folder
git init

# add the remote url
git remote add origin git@github.com:chonchol/amajobs.git

# add your code to the repository
git add .

# commit your code
git commit -m "Message..."

# now once you have your code committed updated your branch with the remote code
git pull 

# now once you have the commit message of the merge - commit and push
git push origin master

【讨论】:

  • 不工作看看所有程序s24.postimg.org/7ptjofuth/Untitled.png
  • 我看到了你的问题,你有一个旧版本的 git。这样做:git pull origin master 它会起作用。
  • 你使用的是旧版本的 git。拉动行为是 git v2.0 中的更改。在这个答案中阅读更多信息:stackoverflow.com/questions/36666709/…
  • 添加分支名称后工作?
  • 酷,很高兴为您提供帮助,如果您将 git 客户端更新到最新版本会更好,更新后您将不再需要在 git pull 之后添加分支名称
猜你喜欢
  • 2019-10-09
  • 1970-01-01
  • 1970-01-01
  • 2018-11-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-12-30
  • 1970-01-01
相关资源
最近更新 更多