Jerry.Shad Jerry.Shad - 29 days ago 16
Git Question

How to fix the issue when uploading project to github?

I am quite new with using git, here I ran into couple issues when uploading my projects to github:


  1. I have installed github desktop and git on windows machine, I got github account and create dummy repository. When I intend to upload my package through git bash command line, I failed to make it. Here is the screen shot what I did:



enter image description here

I used several way to overcome this issues by using existing solution from this community, but still didn't fix the problem. Does anyone know any trick of working this problem ? How can I upload my projects to github successfully ? Any idea ? Thanks in advance :)

Answer

Try the following:

cd /path/to/my/repo
rm -rf .git
git init
git add --all
git commit -m "Initial commit"
git remote add origin <remote repo URL>
git push -u origin master

Be sure to replace /path/to/my/repo with path to your repo directory(e.g. C:\Users\jvrat\Documents\MSPC), and <remote repo URL> with URL to your remote repo (e.g. https://github.com/username/repo_name.git).