skip to Main Content

Im beginner in programming and I am writing a project in vs code and trying to commit new files to synchronize with my github.

But 10,000 files in the directory are writing to me C:Usersgerga.DESKTOP-BSQOQP7 .

I tried to do everything reinstalled.
How do I get git to sync files in my folder and not in another one

I tried to change the folder from where 10,000 comments come from my user folder, I tried to clone to a work package on the desktop. I tried to reinstall git, nothing worked

2

Answers


  1. There are two ways to sync with Github.

    If you created a new repository on Github and you do not have any existing code in your local, simply clone it to your local by getting the https code from Github.

    If you have already code in your machine, as I read you have, you should create a repository on Github (you already did) and now you should sync them. If you create a new repo on Github without readme file Github says:

    …or create a new repository on the command line
    echo "# REPONAME" >> README.md
    git init
    git add README.md
    git commit -m "first commit"
    git branch -M main
    git remote add origin https://github.com/USERNAME/REPONAME.git
    git push -u origin main
    …or push an existing repository from the command line
    git remote add origin https://github.com/USERNAME/REPONAME.git
    git branch -M main
    git push -u origin main
    …or import code from another repository
    You can initialize this repository with code from a Subversion, Mercurial, or TFS project.
    

    which means you need to define your remote, change branch into main (Github has main as default) and push up to Github.

    Login or Signup to reply.
  2. Looks like you are missing .gitignore

    Go to: https://www.toptal.com/developers/gitignore/.
    and generate the ignore file.

    Once generated save it in your main folder as .gitignore

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search