Git synch problems

Hello

I am trying to synchronise my code in Visual Code to Github. However, when I am about to clone it it says that the repository is empty. How can it be empty if I added the files to Github by creating a new repository?

Thanks

Silvia

Hi Silvia,

from what I understand, you have a folder with your project files locally and you want to push them to a Github repo?
How did you create the repository on Github? If you created it on the Github website by clicking the new button, the repository is empty and should be. Otherwise there would be conflicts if you tried to push your local repo to the remote repo.

H,

Yes, the files are locally stored. I triedo to create the repo on Git website.
The thing is that I am trying to synch my code on Visual Code to Github. I have seen different tutorials and cheatsheets and all of them had different instructions.
I don’t really know how to do it. Do you know of a tutorial I can follow?

Thanks

Silvia

you need to download gitbash to your computer and you need to generate ssh keys to connect the remote repository.

check this link how to generate the key.

You shouldn’t clone it since you have your code working locally on your computer and want to upload it (push it). Cloning means to download from github and since your new project on github is empty this is not what you want to do. Instead you will need to push an existing project to the github repo. It may be easier to do this from the command line. You could use git-bash but it is not necessary as long as you have git installed and working from the command-line (in whatever environment you are working - pc, mac, linux). Here is a tutorial:
https://www.digitalocean.com/community/tutorials/how-to-push-an-existing-project-to-github

After you have the basic connection set-up then you can do the following commits and pushes from VS-Code but I usually do basic setup from command-line.

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.