* Adding History
@ 2009-03-19 17:38 Roger Garvin
2009-03-19 17:47 ` Shawn O. Pearce
0 siblings, 1 reply; 3+ messages in thread
From: Roger Garvin @ 2009-03-19 17:38 UTC (permalink / raw)
To: git
Is there a way to add history to a repository?
We have just started using git, where before we had nothing but backup
directories all over the place. We created the git repository using our
existing source directory. Is there a way to now go and add some of the backup
source directories to the history? Or would this break all the SHA1 of the
current objects? I am not sure it would be worth it at this point. But we are
still pretty early in our use of git so now would be the easiest time.
Roger
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Adding History
2009-03-19 17:38 Adding History Roger Garvin
@ 2009-03-19 17:47 ` Shawn O. Pearce
2009-03-20 5:25 ` John Tapsell
0 siblings, 1 reply; 3+ messages in thread
From: Shawn O. Pearce @ 2009-03-19 17:47 UTC (permalink / raw)
To: Roger Garvin; +Cc: git
Roger Garvin <yoyodyn@gmail.com> wrote:
> Is there a way to add history to a repository?
> We have just started using git, where before we had nothing but backup
> directories all over the place. We created the git repository using our
> existing source directory. Is there a way to now go and add some of the backup
> source directories to the history? Or would this break all the SHA1 of the
> current objects?
Right, you need to change the SHA-1 of all of the commits in order
to insert history in the past.
> I am not sure it would be worth it at this point. But we are
> still pretty early in our use of git so now would be the easiest time.
You have two options:
- Use git-filter-branch now to rewrite your commits with the
history added. Its a one-time pain that you need to go through to
discard all of your current objects, and move to the new ones that
have the history.
- Keep the current objects, but if you need the history, add it
to the local repository by editing the grafts file. This is how
the Linux kernel team can insert history that predates Git, if
they absolutely must have it.
It depends on how often you need to look at that history. If its
"almost never", I would probably go with the graft. If its "often",
I would consider the filter-branch now.
--
Shawn.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Adding History
2009-03-19 17:47 ` Shawn O. Pearce
@ 2009-03-20 5:25 ` John Tapsell
0 siblings, 0 replies; 3+ messages in thread
From: John Tapsell @ 2009-03-20 5:25 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: Roger Garvin, git
2009/3/19 Shawn O. Pearce <spearce@spearce.org>:
> Roger Garvin <yoyodyn@gmail.com> wrote:
>> Is there a way to add history to a repository?
>> We have just started using git, where before we had nothing but backup
>> directories all over the place. We created the git repository using our
>> existing source directory. Is there a way to now go and add some of the backup
>> source directories to the history? Or would this break all the SHA1 of the
>> current objects?
>
> Right, you need to change the SHA-1 of all of the commits in order
> to insert history in the past.
>
>> I am not sure it would be worth it at this point. But we are
>> still pretty early in our use of git so now would be the easiest time.
>
> You have two options:
Couldn't you just create import the whole tree and then rebase on top of it?
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-03-20 5:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-19 17:38 Adding History Roger Garvin
2009-03-19 17:47 ` Shawn O. Pearce
2009-03-20 5:25 ` John Tapsell
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).