git push not send changes to remote git repository

Viewed 145915

I am making changes to some file in my local git repository and then want to send the changes to the remote git repository from which the local was cloned via ssh.

After run "git commit -a" on my local side, to send the changes to the remote, I run

$ git push
Everything up-to-date

However I checked the remote files and they are not changed! Any idea?

Thanks and regards!

16 Answers

Well, this is what worked for me

git stash

git pull

git add .

git commit -m "commit message"

git push

I had precisely the same problem as a new git/github user. You have to write this into the command line:

git push -u origin master

That should fix your issue.

One solution is remove the remote and re-insert it, just to reset your local tree and presettings. This issue happens with me when I move folders manually.

To remove yours remotes:

$ git stash

Then:

$ git remote rm <REMOTE NAME> 

i.e. git remote rm origin.

Add again your remote:

$ git remote add origin <URL>

I was facing the same issue and I tried several things none of which worked.

In the end, I added one dummy commit and again pushed the changes and now I can see both (previous one and dummy one) on GitHub remote repository.

Sometimes it just happens due to loading issues. Try opening the link from the branch menu directly in another new tab. This worked for me.

Since i had a similar issue on CentoS 7 with NetworkManager. Pinging the git server gave a response, connecting with netcat (nc) also gave a response, even trying to connect with ssh worked. But the git command just kept on hanging.

In the end it turns out that instead of using NetworkManager and its DNS settings to resolve the git server an entry in /etc/hosts pointed to a wrong ip address which was not reachable.

Related