我将一个文件夹切入了局部存储库中克隆 - 克隆失败,文件夹消失了。我粘贴的文件夹永远消失了吗?

发布于 2025-01-28 11:34:17 字数 208 浏览 2 评论 0原文

我想将本地代码放入GitHub存储库中。

我在github上创建了一个存储库,并尝试用HTTPS克隆。
克隆人花了一点时间,但是该文件夹是在我的笔记本电脑上创建的,因此我决定将本地代码剪切/粘贴到本地回购文件夹中。

好吧,克隆最终失败了,回购文件夹也消失了,以及其所有内容。
我添加到本地存储库的文件夹也消失了。
我什至找不到回收箱。它永远消失了吗?

I wanted to put my local code into a GitHub repository.

I created a repo on GitHub and tried cloning with HTTPS.
The clone was taking a moment but the folder was created on my laptop so I decided to cut/paste my local code into the local repo folder.

Well, the clone ended up failing and the repo folder just disappeared, along with all of its contents.
The folder I added to the local repo also disappeared.
I can't even find it in the recycling bin. Is it gone forever?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

要走就滚别墨迹 2025-02-04 11:34:17

下次:

  • 确保您有已安装gh/code> gh ,github cli
  • 在本地创建一个存储库,在该存储库中,您的代码被
  • 发布到GitHub(将创建远程存储库)

以这种方式,没有克隆,没有危险的代码迁移。

创建远程存储库的命令为(a gh auth login ):

gh repo create

在git存储库中,没有参数,gh将使用目录名称自动在您的帐户上的github上创建一个存储库。

Next time:

  • make sure you have installed gh, the GitHub CLI
  • create a repository locally where your code is
  • publish to GitHub (that will create the remote repository)

That way, no clone, no hazardous code migration.

The command to create the remote repository is (after a gh auth login):
gh repo create.

Inside a git repository, and with no arguments, gh will automatically create a repository on GitHub on your account for your current directory, using the directory name.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文