1

I know this question has been answered before. Here is the most popular thread: Git refusing to merge unrelated histories. What is 'unrelated histories'?

However, I have absolute 0 literacy in coding and don't know how to use a command.

--

To elaborate on my issue--I was able to create a functional site through Atom. I figured out how to publish through github by copying all files from the functional repository to the already created, same-name-as-my-github-profile repository. This allowed me to publish the site, but many elements are now broken. This seems to be because the transfer cleared files & folders apart from js/index/CSS. For instance, my icomoon custom fonts did not appear on the published site but do on the live server because (I assume) they are now missing in the repository but not my computer source url.

Fumbling around has caused me to encounter many more issues such as "Failed to commit - exit code 1 received," "This binary file has changed," etc. on Github Desktop. The original functioning repository also has had the non-js/index/CSS files wiped...

Is there any way to delete the pre-existing github named repository, create a new one of the same name, and drag my working code to this new, clean slate?

Any help is so very appreciated. Thank you.

Will Robbins
  • 23
  • 1
  • 4
  • Just delete `.git` file and cut whole code, and paste in new-folder, then re-clone , then paste that new-folder's code. – Shurvir Mori May 22 '21 at 06:30

2 Answers2

5
  • go to root of your working code and locate and delete .git folder it will disconnect your code from exiting git repository

  • login to github and delete your existing repository / rename repository to new name

  • create a new repository with existing repository name and push your code to this repository.

sandesh dahake
  • 1,028
  • 7
  • 16
3

I had the same problem while using GitHub desktop. The way to solve is:

  1. Open repository folder in explorer
  2. Delete or rename the repository folder
  3. File -> clone repository and choose the right one
  4. Repeat step 1
  5. Copy your project to the folder
  6. Click "fetch origin"
alex
  • 1,042
  • 4
  • 18
  • 33
ilya_kas
  • 159
  • 1
  • 6