我怎样才能将我的本地主机项目推送到 github

how can i push my localhost project to github

您好,我想使用 github,但我不知道如何使用它。我阅读了教程,但我仍然无法弄清楚。

我想要的是我可以将我的项目从我的 xampp 本地主机推送到 github。

我该怎么做?

感谢您的回复

假设您使用 windows:您可以从 Github-for-Windows 安装以下工具。它真的很容易使用,您可以使用设置的工具轻松上传您的本地项目。

您可以创建一个新的存储库:https://github.com/new

git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/yourPseudo/repositoryName.git
git push -u origin master

@bouffe 该说的基本都说了

我发现首先在 github 中创建一个 repo 更容易,选中 "add a readme" 的框,然后一旦你有一个页面,只需在你的 git 中做一个克隆当地环境。这样,您只需输入 git clone https://github.com/yourPseudo/repositoryName.git 即可复制和粘贴。

这样可以节省时间。此外,如果您使用 VS 代码,您甚至不需要再执行 commit -m。只需保存您的更改,然后单击左侧的开发工具,它就会添加并提交所有新文件。让它变得更容易。

确保在设置存储库后执行 git checkout -b "dev"。永远不要在 MASTER 上编写代码。