0

I am working on two machines (one is "local" and another one is "remote"). I did the following set up:

  1. On the "remote" machine: git init --bare repo1
  2. On the "local" machine: git clone ssh://rep1
  3. On the "local" machine: git remote add rep1 ssh://remote_machine/rep1
  4. On the "local" machine: git push remote_machine master

So, in plain text, I create a "relay" repository on my "remote" machine, then, on the "local" machine I clone the repository (from somewhere) and after that I push this repository from "local" machine to "remote" machine.

After that I have updated the "local" repository by executing

git fetch ssh://myname@something1 something2 && git checkout FETCH_HEAD

And now I do not know how do I propagate the changes of the local repository to the remote one. Does any one know how to do it?

ADDED

Since it was confusing, I clarify a bit. There are 3 machines involved but only two of them are important (I refer to them as "local" and "remote"). I pull from this third machine (that does not have a name) when I am being on the "local" machine. In other words, the content of the "local" machine is taken from the third machine. What I want to achieve is to propagate what I have on the "local" machine to the "remote" machine (and again, the "remote" machine is not the same as the "third" machine).

ADDED 2

The problem is that git push does not work for whatever reason. When I am on the "local" machine and execute git log I see some commits from today. Then I execute the same push that I used to create the original content of the remote repository: git push remote_machine master. This command tells me:

Killed by signal 1.
Everything up-to-date

I go to the remote machine and execute git log and I see only commits that were done several weeks ago (and I do not see the commit from today, that I do see on the local machine).

Roman
  • 97,757
  • 149
  • 317
  • 426
  • 1
    Ok there are some thing with your question that make me confused. You adressed 3 different remotes in your description. It is easierer to follow your test if you have a consistent structure. I can't see this structure right now and I actually can't follow your description. So maybe you reinvest some time to rephrase the question a bit. – ckruczek Nov 29 '17 at 14:40
  • How do propagate the changes of the local repository to remote master? add the files, commit and push to origin master. If your in branch then merge the branch to local master and then push your local master to origin. – danglingpointer Nov 29 '17 at 14:40
  • You propagate changes from the local to a remote with `git push`. – Mark Adelsberger Nov 29 '17 at 14:42
  • Normally you would push a commit from local to remote. Why is that not working for you? – JDB still remembers Monica Nov 29 '17 at 14:51
  • Have you created a new branch, or do you still have the detached head (FETCH_HEAD) checked out? See https://stackoverflow.com/questions/35736116/making-a-git-push-from-a-detached-head/35736137 – JDB still remembers Monica Nov 29 '17 at 14:54
  • Or perhaps you are trying to merge in the changes from your relay repo? In which case rather than executing `git checkout FETCH_HEAD` you might want to run `git merge FETCH_HEAD` – JDB still remembers Monica Nov 29 '17 at 14:56

1 Answers1

0

What worked for me is going to the "remote" machine and executing git pull. After that I was able to see the commit from today by executing git log on the "remote" machine.

Roman
  • 97,757
  • 149
  • 317
  • 426
  • If a git pull on the remote fixed it for you, then you weren't pushing to your "remote" machine. You were pushing to a third repo that is the true remote for both your "local" and "remote" machines. – JDB still remembers Monica Nov 29 '17 at 15:09