Answer the question
In order to leave comments, you need to log in
How to make different branches in git automatically uploaded to different repositories?
Aloha everyone!
I'm new to Git don't throw slippers.
We always worked like this, hub -> origin
hub - bare
origin - production
Everyone uploaded it to hub automatically, via Post-update (git pull hub master), uploaded it to origin.
Now there is another repository dev(clone origin).
I would like to have 2 branches origin and dev, dev is automatically uploaded to dev, and origin to origin.
Or from dev to distill to origin without transferring all Revisions
I don’t understand how to do this.
Answer the question
In order to leave comments, you need to log in
made two branches dev and stable
moved head in each repository with git symbolic-ref HEAD refs/head/<Branch_name> and git checkout -b dev
fixed Post-update
to dev git pull hub dev
to origin git pull hub stable
now to hub
$ git branch
dev
* master
stable
$ git status
fatal: This operation must be run in a work tree
$ git branch
fatal: HEAD not found below refs/heads!
$ git status
On branch refs/head/dev
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: index.php
$ git branch
master
* stable
$ git status
On branch stable
nothing to commit, working directory clean
14:21:20.451: git -c core.quotepath=false checkout f6bc7ac6422f6e63dfa8bed5a6389a1c431d9edb --
Previous HEAD position was f845007... тест новых веток2
HEAD is now at f6bc7ac... тест новых веток
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question