I need to work with an intricate configuration of repositories. I have 5 of them:
- A remote central repository on machine 1.
- My local repository on my notebook (machine 2).
- A bare repository on machine 3.
- A repository on machine 3.
- A repository on machine 4 where we do code review.
So, my understanding that it works this way:
- On my laptop (machine 2) I clone / pull from the central repository located on machine 1.
- I push the local repo to the machine 3 (using the bare repository as a "intermediate").
Now I did some changes on the machine 3 and I want to push these changes to machine 4. Here are the instructions that I need to follow:
- On machine 3 do all work in your test-branch, commit.
- Push to your bare repo on machine 3: git push origin test-branch
- On your laptop: fetch new commits from the machine-3 repo: git fetch machine3
- Check out your branch from machine 3: git checkout -b test-branch machine-3/test-branch
- Fetch commits from machine-4: git fetch origin
- git rebase origin/master
- git push origin HEAD:refs/for/master
I have problems with step 4. I get the following error:
fatal: 'machine3/test-branch' is not a commit and a branch 'test-branch' cannot be created from it
ADDED
When I execute
git rev-parse machine3/test-branch
On my laptop (machine 2) I get:
machine3/test-branch
fatal: ambiguous argument 'machine3/test-branch': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]'
git checkout -b test-branch machine-3/test-branch
needs a working tree, so it fails. Besides, you need to check ifmachine3/test-branch
exists. mijingo.com/blog/what-is-the-working-tree-in-git – Corniegit rev-parse machine3/test-branch
echo? – Cornie