简体   繁体   English

当我尝试按照教程添加本地存储库时,由于“此目录似乎不是Git存储库”,它给了我错误提示

[英]When I try to add local repository as per the tutorial, it gives me error as 'this directory does not appear to be a Git repository'

I want to upload my project to GitHub account. 我想将我的项目上传到GitHub帐户。 When I try to add local repository as per the tutorial, it gives me error as 'this directory does not appear to be a Git repository' 当我尝试按照教程添加本地存储库时,由于“此目录似乎不是Git存储库”,它给了我错误提示

enter image description here 在此处输入图片说明

You need to initialize repository first. 您需要先初始化存储库。 You can do it by running command below in your terminal. 您可以通过在终端中运行以下命令来执行此操作。

git init

Basically you need to follow these steps. 基本上,您需要遵循以下步骤。

First initialize the git in a specific folder. 首先在特定文件夹中初始化git。

git init

Then take the https or ssh link of the github repository and add as a remote. 然后,使用github存储库的https或ssh链接并将其添加为远程对象。

git remote add origin master [url of repository]

Then need to add all files or folders 然后需要添加所有文件或文件夹

git add -A

It will add all the files and folders of the project. 它将添加项目的所有文件和文件夹。

If you want to know the status of it that which files and folder are going to be upload 如果您想知道将要上传哪些文件和文件夹的状态

git status

Then you need to commit and write the message 然后,您需要提交并编写消息

git commit -m "first commit"

Then you need to push all this. 然后,您需要推动所有这一切。

git push origin master

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

相关问题 当我尝试将Selenium与python结合使用以打开Chrome浏览器时,Windows给我一个FileNotFoundError:[WinError 2] - When I try to use Selenium with python to open a Chrome browser, windows gives me a FileNotFoundError: [WinError 2] 使用带有 try except 块的 for 循环,但仍然给我一个错误 - Using a for loop with a try except block but still gives me an error Selenium ChromeDriver每次尝试运行时都会给我SerializationException - Selenium ChromeDriver gives me SerializationException every time I try to run it 如何添加除Central以外的Maven存储库? - How Do I Add A Maven Repository Other Than Central? 当我尝试执行selendroid命令时出错 - Error when i try to execute selendroid command 使用Eclipse在SVN存储库中添加对项目的引用 - Add Reference to Project at SVN Repository using Eclipse 如何将 chromedriver 添加到我的 github 存储库 - How to add chromedriver to my github repository 当尝试使用 selinum 访问 go 下一页时,它会给出列表索引超出范围错误 - When try to go next page using selinum it gives list index out of range error 为什么我在无头模式下运行时没有出现浏览器? - Why does a browser not appear when I run in headless mode? 当我尝试使用 selenium xpath 抓取 Web 表格文本值时,它给出了空文本值 - When i try to scrape web table text values using selenium xpath it gives empty text values
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM