R
R
Roman2016-12-12 13:43:50
git
Roman, 2016-12-12 13:43:50

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

5 answer(s)
R
Roman, 2016-12-12
@GUY

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

now in dev
$ 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

now in origin
$ git branch
  master
* stable

$ git status
On branch stable
nothing to commit, working directory clean

trying to pull to dev from working PC, in the end
14:21:20.451: git -c core.quotepath=false checkout f6bc7ac6422f6e63dfa8bed5a6389a1c431d9edb --
Previous HEAD position was f845007... тест новых веток2
HEAD is now at f6bc7ac... тест новых веток

f845007 is stable
f6bc7ac is dev
What have I done and how can I fix it?
added a comment to dev. The error in dev is gone, but the changes are not applied to stable, and in dev 'detached HEAD'
Cunning manipulations returned to the system hub -> origin

A
akzhan, 2016-12-12
@akzhan

something like
https://help.github.com/articles/configuring-a-rem...

4
4iloveg, 2017-04-21
@toozox

https://regex101.com/r/SqgeeI/1

S
sergski, 2017-04-21
@sergski

like this
/\<(\/?[^\>]+)\>/

S
Sergej, 2017-04-21
@sayber

And should?
Here's to you for the future www.phliveregex.com , https://regex101.com
Check and test, then contribute to the code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question