Reputation: 5129
I created a github new repository first in github webpage and then I opened Git Bash to upload folders to this repository. I first used $cd f:
and $ git clone [email protected]:username/project name.git
to create a folder(with a initial .git folder and a README file in it) in f disk. Then, I used $cd f:\project name
to switch to the current folder. After that, I copied all my project folders to my project name folder in f disk. Finally, I used the following four lines to upload all my project folders to github:
$git add .
$git remote rm origin
$git remote add origin [email protected]:username/project name.git
$git push -u origin master
After I entered the passphrase, Git Bash just showed everything up-to-date. But I refreshed my github repository page, there is nothing but the initial README file. Could someone tell me what the matter is?
Upvotes: 1
Views: 245
Reputation: 1323243
You didn't commit after your git add
.
git commit -m "first commit"
That is why git considered there was nothing to push: you HEAD was still the same than your remote origin cloned repo.
See Git Basics:
Your git add
updating the staging area (index), but only a git commit
will update your git directory.
Upvotes: 2