1

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!

3
  • 1
    Well, you need to push. commit will only add a commit to your local repository. git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes Commented Jul 18, 2015 at 12:48
  • Run git pull to sync first Commented Jul 18, 2015 at 12:53
  • git pull --> Allready up-to-date! This also doesn't help. :/ Commented Jul 18, 2015 at 12:59

1 Answer 1

5

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
Sign up to request clarification or add additional context in comments.

3 Comments

git remote add origin github.com/kamekame/wolke --> fatal: remote origin already exists.
git push origin master --> Everything up-to-date
and you are saying that the files still aren't pushing? check your origin remote by git remote -v. if the remote url doesn't look right, you can reset it with git remote set-url origin url. also, you should be able to pull without errors if it's setup correctly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.