git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Pushing everything
@ 2010-10-31  5:47 Maaartin
  2010-10-31  6:43 ` Tay Ray Chuan
  2010-10-31 12:30 ` Konstantin Khomoutov
  0 siblings, 2 replies; 6+ messages in thread
From: Maaartin @ 2010-10-31  5:47 UTC (permalink / raw)
  To: git

I'd like to push all my branches and tags to the server, but for whatever reason 
"--all" ignores tags and is incompatible with "--tags". I could imagine there's 
a reason I'm not experienced enough to see?

It seems to me that "--mirror" is quite unusable, since it force-overwrites the 
remote repo and even deletes refs not locally present. Obviously, a mirror can't 
be shared, and it doesn't seem to me to be the ideal backup solution for a 
single person.

However, even if "git push -all -tags"  worked, I'm not sure it's a good idea 
for project with more collaborators. There may be conflicts or other problems 
and quite often the pushing occurs just before leaving so it's no good time to 
start resolving conflicts. Can a shared repo be used as a sort of backup as 
well? I'd like a possibility to backup all my work there anytime without needing 
to care about anything. This could work by creating sort of private refs in case 
of any problems, or whatever. Is there something like this, or am I thinking 
astray? I'd suppose, something like this could be very useful for a company 
where it'd provide a simple backup solution for everybody.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Pushing everything
  2010-10-31  5:47 Pushing everything Maaartin
@ 2010-10-31  6:43 ` Tay Ray Chuan
  2010-10-31  9:48   ` Andreas Schwab
  2010-10-31 12:30 ` Konstantin Khomoutov
  1 sibling, 1 reply; 6+ messages in thread
From: Tay Ray Chuan @ 2010-10-31  6:43 UTC (permalink / raw)
  To: Maaartin; +Cc: git

On Sun, Oct 31, 2010 at 1:47 PM, Maaartin <grajcar1@seznam.cz> wrote:
> I'd like to push all my branches and tags to the server, but for whatever reason
> "--all" ignores tags and is incompatible with "--tags". I could imagine there's
> a reason I'm not experienced enough to see?

You can spell the refs explicitly, like this:

  $ git push refs/heads/* refs/tags/*

Modify the glob to taste.

-- 
Cheers,
Ray Chuan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Pushing everything
  2010-10-31  6:43 ` Tay Ray Chuan
@ 2010-10-31  9:48   ` Andreas Schwab
  2010-10-31 10:48     ` Maaartin
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Schwab @ 2010-10-31  9:48 UTC (permalink / raw)
  To: Tay Ray Chuan; +Cc: Maaartin, git

Tay Ray Chuan <rctay89@gmail.com> writes:

> On Sun, Oct 31, 2010 at 1:47 PM, Maaartin <grajcar1@seznam.cz> wrote:
>> I'd like to push all my branches and tags to the server, but for whatever reason
>> "--all" ignores tags and is incompatible with "--tags". I could imagine there's
>> a reason I'm not experienced enough to see?
>
> You can spell the refs explicitly, like this:
>
>   $ git push refs/heads/* refs/tags/*

The first argument needs to be a reference to a repository, so insert an
origin here.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Pushing everything
  2010-10-31  9:48   ` Andreas Schwab
@ 2010-10-31 10:48     ` Maaartin
  2010-10-31 11:32       ` Mathias Lafeldt
  0 siblings, 1 reply; 6+ messages in thread
From: Maaartin @ 2010-10-31 10:48 UTC (permalink / raw)
  To: git

Andreas Schwab <schwab <at> linux-m68k.org> writes:
> 
> Tay Ray Chuan <rctay89 <at> gmail.com> writes:
> 
> > On Sun, Oct 31, 2010 at 1:47 PM, Maaartin <grajcar1 <at> seznam.cz> wrote:
> >> I'd like to push all my branches and tags to the server, but for whatever 
reason
> >> "--all" ignores tags and is incompatible with "--tags". I could imagine 
there's
> >> a reason I'm not experienced enough to see?
> >
> > You can spell the refs explicitly, like this:
> >
> >   $ git push refs/heads/* refs/tags/*
> 
> The first argument needs to be a reference to a repository, so insert an
> origin here.

Nice, that works. It answers only a part of my questions, but maybe I can 
complete it. I want to use a repo as both a private backup (which everybody may 
read but nobody should) and a shared base. So maybe something like

git push origin +refs/heads/*:refs/heads/maaartin-* +refs/tags/*:refs/tags/
maaartin-* :

would do both the backup (where everything gets prefixed by my name) and normal 
pushing of tracking branches. Could it work? Should I try it out or can it be 
destructive?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Pushing everything
  2010-10-31 10:48     ` Maaartin
@ 2010-10-31 11:32       ` Mathias Lafeldt
  0 siblings, 0 replies; 6+ messages in thread
From: Mathias Lafeldt @ 2010-10-31 11:32 UTC (permalink / raw)
  To: Maaartin; +Cc: git

On 10/31/2010 11:48 AM, Maaartin wrote:
> Andreas Schwab <schwab <at> linux-m68k.org> writes:
>>
>> Tay Ray Chuan <rctay89 <at> gmail.com> writes:
>>
>>> On Sun, Oct 31, 2010 at 1:47 PM, Maaartin <grajcar1 <at> seznam.cz> wrote:
>>>> I'd like to push all my branches and tags to the server, but for whatever 
> reason
>>>> "--all" ignores tags and is incompatible with "--tags". I could imagine 
> there's
>>>> a reason I'm not experienced enough to see?
>>>
>>> You can spell the refs explicitly, like this:
>>>
>>>   $ git push refs/heads/* refs/tags/*
>>
>> The first argument needs to be a reference to a repository, so insert an
>> origin here.
> 
> Nice, that works. It answers only a part of my questions, but maybe I can 
> complete it. I want to use a repo as both a private backup (which everybody may 
> read but nobody should) and a shared base. So maybe something like
> 
> git push origin +refs/heads/*:refs/heads/maaartin-* +refs/tags/*:refs/tags/
> maaartin-* :
> 
> would do both the backup (where everything gets prefixed by my name) and normal 
> pushing of tracking branches. Could it work? Should I try it out or can it be 
> destructive?

Hi,

why don't you try pushing to a local clone first, and then check the results?

This puts your data at no risk.

-Mathias

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Pushing everything
  2010-10-31  5:47 Pushing everything Maaartin
  2010-10-31  6:43 ` Tay Ray Chuan
@ 2010-10-31 12:30 ` Konstantin Khomoutov
  1 sibling, 0 replies; 6+ messages in thread
From: Konstantin Khomoutov @ 2010-10-31 12:30 UTC (permalink / raw)
  To: Maaartin; +Cc: git

On Sun, Oct 31, 2010 at 05:47:38AM +0000, Maaartin wrote:

> I'd like to push all my branches and tags to the server, but for whatever reason 
> "--all" ignores tags and is incompatible with "--tags". I could imagine there's 
> a reason I'm not experienced enough to see?
> 
> It seems to me that "--mirror" is quite unusable, since it force-overwrites the 
> remote repo and even deletes refs not locally present. Obviously, a mirror can't 
> be shared, and it doesn't seem to me to be the ideal backup solution for a 
> single person.
> 
> However, even if "git push -all -tags"  worked, I'm not sure it's a good idea 
> for project with more collaborators. There may be conflicts or other problems 
> and quite often the pushing occurs just before leaving so it's no good time to 
> start resolving conflicts. Can a shared repo be used as a sort of backup as 
> well? I'd like a possibility to backup all my work there anytime without needing 
> to care about anything. This could work by creating sort of private refs in case 
> of any problems, or whatever. Is there something like this, or am I thinking 
> astray? I'd suppose, something like this could be very useful for a company 
> where it'd provide a simple backup solution for everybody.
You can have any number of remotes configured for your local repo.
So you can easily have one "private" remote repo which you use solely
for "backup" pushes and one "shared" remote repo to which you do careful
selective pushes.

Note that I'm obsessed with the "backup" idea no less than you and when
I started using Git I learned about --mirror and did mirror push to my
private remote repo before leaving office, just as you explained.
But then I realized this was just a hangover from my Subversion
backgrounds, and that to really need --mirror doing regular programming,
you have to be fantastically, inhumanly productive. I mean, after a
typical one work day programming session you usually have a clear idea
about what branch(es) and what tags, if any, you have to push for backup
purposes. So it really might be a non-issue.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-10-31 12:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-31  5:47 Pushing everything Maaartin
2010-10-31  6:43 ` Tay Ray Chuan
2010-10-31  9:48   ` Andreas Schwab
2010-10-31 10:48     ` Maaartin
2010-10-31 11:32       ` Mathias Lafeldt
2010-10-31 12:30 ` Konstantin Khomoutov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).