I'm currently trying to push some of my project files to github but I've been banging my head against the table now trying to figure out what is going wrong. Any help would be greatly appreciated.
What I do is I first created a new folder in my c:/ directory called cs188 and put all the files that I want committed in that folder. MY goal is to push the whole cs188 folder I created to github.
In git bash, I type:
(in the cs188 folder):
git init
git add .
git commit -m "first commit"
Now I add the remote
git remote add origin https://github.com/my_username/myrepos.git
(myrepos is the name of my repository on github)
Then afterwards I type:
git push origin master
I get a warning saying that "the tip of my current branch is behind its remote counterparts. Merge the remote changes before pushing again
".
So now I type:
git pull origin master
But once this is done, my whole new folder has been replaced with the contents of my repos.
And once I type git push origin master
, now and log onto my github account, nothing has changed or been added.
Does anyone have any idea what I'm doing wrong here?
Why is my new folder getting replaced with all the folders in my repository?
What should I do instead to get rid of "the tip of my current branch is behind its remote counterparts", and have my whole cs188
folder show up on github?
Any help is appreciated, I'm just completely frustrated with github right now and could really use some help.