top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

git push doesn't update the status with multiple remotes?

+1 vote
297 views

I'm using git 1.9.1 in Ubuntu 14.04.

I have a repository on github, a clone on my desktop and bare repo on a private server, in my desktop the remotes looks like this

all git@github.com:user/repo.git (fetch)
all git@github.com:user/repo.git (push)
all user@server.com:user/repo.git (push)
server user@server.com:user/repo.git (fetch)
server user@server.com:user/repo.git (push)
origin git@github.com:user/repo.git (fetch)
origin git@github.com:user/repo.git (push)

If I commit to master in my desktop and run 'git push all master', the github and the server repos are correctly updated, but if I run 'git status' the message says:

Your branch is ahead of 'origin/master' by 1 commit.
 (use "git push" to publish your local commits)

The message won't update unless I run git fetch or git push origin master. I'd expect the git status to give me a updated status message after calling 'git push all master'.

posted Jul 11, 2016 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)

But "all" and "origin" are different remotes. Just because you use the same URL does not make them the same remote repository from the view of your local repository.

(Additionally, "all" is not a special name, just in case you had expected that.)

The message won't update unless I run git fetch or git push origin master.

Yes, that's how it is supposed to work.

I think there is some way to configure that a single push command pushes to several remote repositories, but I can't find it right now...

answer Jul 12, 2016 by Kiran
Similar Questions
+1 vote

In my superproject I have two submodules and I want them to track always master master. Using Git 1.8.2.
So I've added "branch = master" to .gitmodules and using git submodule update --remote to pull always recent master.
However everytime submodule master is updated, running superproject git status or diff shows its recorded sha1 has changed.
This doesn't make sense since I am tracking master? Shouldn't it show it has changed only when submodule HEAD is not the branch recorded in my superproject's .gitmodules ??

+1 vote

I wanted to avoid push if any of the files is deleted from the local git clone area. Can anyone please help me with that?

I am using Stash for repository management.

+1 vote

The use case:
"git submodule update" seems to be inefficient when running sequentially on a large .gitmodules file. Assuming a git forest with over 7K gits it takes hours to complete the update (running on Windows+Cygwin)

If not supported, this feature could be a good candidate for "git submodule" enhancement.
What is your opinion or advice?

+1 vote

Anyone encountered the following error

In the remote central depository, I have 2 git depositories.
I am able to clone/pull from the 2 git depositories using https but when issue a pull, it gives return code 22 fatal: git-http-push failed error

...