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?

1

There are 1 answers

0
VonC On

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.