Is it possible to hide a branch in the git repository for all remote clones?

I have a central repository in serverand local repositories in local. The repository serverhas a branch livethat sometimes pulls out master, adds some changes, and then uses it to update the service.

Branching is live servernot of interest to users in their repositories local. They should not see this and are not able to get it / click on it, in short, interact with it in any way.

Is there a way in Git to allow this behavior: Do I prevent the branch from being serverlisted in the repository local?

local$ git remote add server example.com
local$ git fetch server
local$ git branch --remotes
server/foo
server/live     # <-- don't show this branch
server/master

A solution on would be preferable server. But at the moment, since there is currently no unreliable committer, solutions will work that simply hide the branch livethrough the configuration in the repositories local.

+4
source share
1 answer

Edit : with git 1.8.2, git supports transfer.hiderefs(written transfer.hiderefsin git configuration documentation ). This was a bit of a bug before git 2.3.5 / 2.4.0 (as well as avoiding this if you allow smart-http transfers until you have 2.3.5 or 2.4.0 on the server).

To hide the server / live:

git config --add transfer.hiderefs refs/heads/server/live

: ( receive.hiderefs). . uploadpack.allowTipSHA1InWant.

: git . ( , , , - , , , , . , ref "de-live-d" . , , , , , "" - , , , "" .)

- - - , , . , , - .

+2

Source: https://habr.com/ru/post/1534987/


All Articles