Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > pt.comp.programacao > #24
| From | JJ <jj.mailspam@yahoo.com> |
|---|---|
| Newsgroups | pt.comp.so.linux, pt.comp.programacao |
| Subject | Re: git e vários "remotes" |
| Date | 2018-02-21 17:43 +0000 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <p6kb45$pkn$1@gioia.aioe.org> (permalink) |
| References | <movvtt$mr7$1@speranza.aioe.org> <mp4ork$5n3$1@speranza.aioe.org> <p6k49v$62p$1@dont-email.me> |
Cross-posted to 2 groups.
Às 15:47 de 21-02-2018, Manifest0 escreveu: > (snip) > On Mon, 27 Jul 2015 08:07:16 +0000, Ninguém wrote: >> On Sat, 25 Jul 2015 12:37:18 +0000, Ninguém wrote: >>> Alguém me sabe instruir sobre como evitar fazer asneiras com o git? No >>> seguinte aspeto: >>> >>> Tenho um projeto com 2 "remotes" configurados (imagine-se um da empresa >>> - >>> empresa - e outro privado - meuservidor). Mantenho um "branch" que >>> sincronizo com o repositório da empresa (master -> empresa/master) e >>> outro que sincronizo com a minha versão do projeto que é ligeiramente >>> diferente (meu -> meuservidor/master). >>> >>> Agora: como é que configuro o git para me impedir de fazer burrices e >>> fazer "push" do meu "branch" pessoal para o servidor da empresa, por >>> exemplo? >> >> Penso que se me restringir a fazer "git push" e não indicar um "remote", >> ele empurra para o "remote" correto. Basta não forçar a barra. >> Pelo menos é o que me pareceu. Olá, Não sei se isto é uma resposta a esta tua pergunta de 2015 (na altura sabia muito menos sobre GIT do que sei agora)... Quando faço "git push" num repositório que aqui tenho e que tem 2 branches, dá-me esta mensagem de aviso: $ git push warning: push.default is unset; its implicit value has changed in Git 2.0 from 'matching' to 'simple'. To squelch this message and maintain the traditional behavior, use: git config --global push.default matching To squelch this message and adopt the new behavior now, use: git config --global push.default simple When push.default is set to 'matching', git will push local branches to the remote branches that already exist with the same name. Since Git 2.0, Git defaults to the more conservative 'simple' behavior, which only pushes the current branch to the corresponding remote branch that 'git pull' uses to update the current branch. See 'git help config' and search for 'push.default' for further information. (the 'simple' mode was introduced in Git 1.7.11. Use the similar mode 'current' instead of 'simple' if you sometimes use older versions of Git) --------------------------- Parece-me, pelo menos, que há uma maneira de evitar que o git crie remote branches que não existem. No modo "matching" só faz push dos branches que já existem. Ou então, configurar como "simple" e garantir que "origin" não é um branch válido. Vê as opções "branch.*.remote" e "remote.*.push". Infelizmente não te sei dar uma resposta mais informada. Espero ter ajudado, caso (ainda) tenhas esta dúvida. Um abraço. -- JJ Usenet PT: Bem-vindo à hierarquia pt.* de Net News! http://www.usenet.pt/
Back to pt.comp.programacao | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: git e vários "remotes" Manifest0 <Manifest0@noemaildomainhere.org> - 2018-02-21 15:47 +0000
Re: git e vários "remotes" JJ <jj.mailspam@yahoo.com> - 2018-02-21 17:43 +0000
Re: git e vários "remotes" Ninguém <usenet@rasparta.org> - 2018-02-22 07:59 +0000
Re: git e vários "remotes" Ninguém <usenet@rasparta.org> - 2018-02-22 07:56 +0000
Re: git e vários "remotes" JJ <jj.mailspam@yahoo.com> - 2018-02-22 12:11 +0000
Re: git e vários "remotes" Ninguém <usenet@rasparta.org> - 2018-02-22 21:36 +0000
Re: git e vários "remotes" Manifest0 <Manifest0@noemaildomainhere.org> - 2018-03-13 22:57 +0000
Re: git e vários "remotes" Ninguém <usenet@rasparta.org> - 2018-03-14 23:17 +0000
csiph-web