kame
kame

Reputation: 21950

git: Can't add files to github

I found some similar questions like this. But I can't find a solution.

I add a folder with files and sub-folders to my local repository using:

git add .

And then with:

git commit -m "comment"

I get:

On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean

The problem is, that I can't find the files on github. Any ideas?

EDIT:

git push -u [email protected]:kamekame/wolke master

gives:

To [email protected]:kamekame/wolke
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to '[email protected]:kamekame/wolke'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

SOLUTION:

git remote -v

gives me:

origin  [email protected]:kamekame/alpha.git (fetch)
origin  [email protected]:kamekame/alpha.git (push)

which was different from my push adress kamekame/wolke!

Upvotes: 1

Views: 4324

Answers (1)

Mike D
Mike D

Reputation: 6195

You need to set your local repo to push upstream to your github repo. from: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line

Your next steps would be:

# create repo via github ui or github cli

# add github as the origin
git remote add origin remote_repository_URL

# push changes to repo
git push origin master

Upvotes: 5

Related Questions