github committed files don't show up on

2019-01-26 18:22发布

问题:

Newb question:

I add a file to my repo (drag it to my repo folder) then in git bash I "cd" to my repo and "git init", "git add filename", "git commit -m 'committing files'". When I git status it says

$ git status
#on branch master
#your branch is ahead of origin master by 2 commits
#
working directory clean. Nothing to commit.

But they don't show up in my repo when I refresh the page on my github site. Do I have to push them to the site?

回答1:

Do I have to push them to the site?

Yes. Commits are to your local repository first. You need to git push origin master for the commits to be on GitHub.



回答2:

You need to push the changes out to your remote on github.

You've commited the changes to your local repository - but that doesn't automatically push them out to your remote. Try this:

git push origin master


标签: github push