简体   繁体   English

为什么我不能将我的项目推送到 Github 上的存储库

[英]Why i can't push my project to my Repository on Github

i just follow this steps to upload this project to repository in my github我只需按照以下步骤将此项目上传到我的 github 中的存储库

enter image description here在此处输入图像描述

and this problem comes, how i can fix this?这个问题来了,我该如何解决这个问题? enter image description here在此处输入图像描述

You need to stage your modified files first with commands:您需要先使用命令暂存修改后的文件:

git add <yourfile>

Git itself have stage area which was contains of your file that going to commited to your repo. Git 本身具有阶段区域,其中包含将提交到您的存储库的文件。 For better explanation why it need to be staged ...为了更好地解释为什么需要上演...

well If you don't want to git adding them one by one xD, you can use好吧,如果您不想 git 将它们一一添加 xD,您可以使用

git add -u // will added your modified files to stage 
git add * // which will add all of your files including your new files (literally everything to stage)
git commit -a // will commiting 

A little bonus, Git Cheat Sheet xD Also i have little advie, it was better if you work with your code around with Visual Code... its more simply to commit a changes to your repo in github with feature there.一点好处, Git 备忘单 xD我也有一点建议,如果你使用 Visual Code 处理你的代码会更好......它更简单地在 github 中对你的 repo 进行更改,并具有那里的功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM