I am attempting to push my updated files to a remote repository on github, operating OSX Snow Leopard using git version 1.8.4.2.
I have successfully done git init followed by git add . and git remote add origin https://github.com/me/repo.git. I then did a git commit -m "first commit" followed by git push origin master
All of this worked great
The problem is that I have a message returned to me when I try to commit and push again. I updated some files for example, did a commit with a message, and then ran git push remote origin.
The command works except it says "Everything up-to-date". I scanned a half dozen or so stack overflow questions with similar errors and a lot of them relating to not being on the correct branch or being in detached head mode. I believe my case is neither.
Here is the result of git log --graph --all --decorate --pretty=oneline:
* 6926001f0eed54c05f807eb04ed05fd0584cd2e6 (HEAD, origin/master, master) first commit
and here is git remote show origin
* remote origin
Fetch URL: https://github.com/me/repo.git
Push URL: https://github.com/me/repo.git
HEAD branch: master
Remote branch:
master tracked
Local ref configured for 'git push':
master pushes to master (up to date)
and here is git branch -v
* master 6926001 first commit
I am not sure what other information I can provide, but please do let me know and I will update the question. I am fairly new to git, thanks for reading!
Edit:
I ran the second commit again and got this message:
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: file1
# modified: file2
# modified: file3
#
no changes added to commit (use "git add" and/or "git commit -a")
git logoutput shows that you still have just the one initial commit. Are you sure your second commit actually worked?git add .(unless that doesn't do what I thought it does)git add file1 file2 file3, or use the shortcutgit commit -a(-a= auto-add-and-commit all the files thatgit statusshows as modified). With no changes staged for commit, by default "git commit" doesn't make a new commit.git commit -a <files>