'Git push says "Everything up-to-date" but it's not
My Github repo won't update after git push -u origin master command!
It says:
Branch 'master' set up to track remote branch 'master' from 'origin'. Everything up-to-date
The result for git remote show origin is:
* remote origin
Fetch URL: [email protected]:MyGithubID/RepoName.git
Push URL: [email protected]:MyGithubID/RepoName.git
HEAD branch: master
Remote branch:
master tracked
Local branch configured for 'git pull':
master merges with remote master
Local ref configured for 'git push':
master pushes to master (up to date)
and for git status:
On branch master
Your branch is up to date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: myFile.m
I have no idea what is going on! I tried git push --all origin and it says: Everything up-to-date but it's not!
I'm new with git; I checked 'config' file in my .git directory and the information is correct. What is wrong with my git?!
Solution 1:[1]
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: myFile.m
That implies that you have to commit your changes. So, you've done well, you're almost there you just have to do a:
git commit -m "Here a short descriptive message" -m "Here a longer more detailed message"
and then you can do your push:
git push origin master
Solution 2:[2]
Follow the official documentation:- https://git-scm.com/docs/gittutorial
Before push you will have to first add all the resources where the changes you have done.
git add . or git add --all
Then commit it using
git commit -m "your message".
and push code using
git push origin master == replace master with your remote branch
name where you want to push.
Solution 3:[3]
if you are adding new project try below steps :
rm -rf .git/
git init
git remote add origin https://repository.remote.url
git add .
git commit -m “Commit message here”.
git push -f origin master
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | nikoksr |
| Solution 2 | Himanshu Sharma |
| Solution 3 | MANISH |
