git question

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

git question

Paul Franklin-5
I am trying to learn about git.  I don't know much yet.

I am experimenting with having several layers of repos, on
the theory that I will be able to avoid doing something bad
to the real SourceForge repo that way.  Something like:

SourceForge ==> gramps-official ==> gramps-mycopy

(which I made with two "git clone" commands, the last one
with just a local directory as the source).

(I used to do something similar with svn, and I manually
transferred my changes by making a patch with "svn diff" and
then applying that patch in my master copy.  But I'm trying
to avoid doing it that exact way with git, although I guess
it would work.  I'm using git 1.7.4.4 if it matters.)

But I haven't yet stumbled on the right set of commands to
be able to do a "git push" in my "gramps-mycopy" repo and
have my changes get pushed to my "gramps-official" repo.
(Where I would eventually "git push" them to SourceForge.)
I want to learn how to do a "git push" between two local
repos before I ever try a push to the real SourceForge repo.

Probably all of you know git well enough that you would have
no reason to do something like this, but I'm hoping you also
know git well enough that you can tell me how I can do it.

Thanks.

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: git question

Adam Stein-3
You don't have to do the 2 git clone commands.  Git does automatically
what you've been doing manually with svn.  When you commit in git, it
doesn't go up to the repo like it does with svn.  You need to run 'git
push' to go from your local repo to the remote one.

On Sat, 2014-01-18 at 16:33 -0800, Paul Franklin wrote:

> I am trying to learn about git.  I don't know much yet.
>
> I am experimenting with having several layers of repos, on
> the theory that I will be able to avoid doing something bad
> to the real SourceForge repo that way.  Something like:
>
> SourceForge ==> gramps-official ==> gramps-mycopy
>
> (which I made with two "git clone" commands, the last one
> with just a local directory as the source).
>
> (I used to do something similar with svn, and I manually
> transferred my changes by making a patch with "svn diff" and
> then applying that patch in my master copy.  But I'm trying
> to avoid doing it that exact way with git, although I guess
> it would work.  I'm using git 1.7.4.4 if it matters.)
>
> But I haven't yet stumbled on the right set of commands to
> be able to do a "git push" in my "gramps-mycopy" repo and
> have my changes get pushed to my "gramps-official" repo.
> (Where I would eventually "git push" them to SourceForge.)
> I want to learn how to do a "git push" between two local
> repos before I ever try a push to the real SourceForge repo.
>
> Probably all of you know git well enough that you would have
> no reason to do something like this, but I'm hoping you also
> know git well enough that you can tell me how I can do it.
>
> Thanks.
>
> ------------------------------------------------------------------------------
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Between.
> Get a Quote or Start a Free Trial Today.
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
> _______________________________________________
> Gramps-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gramps-devel

--
Adam ([hidden email])



------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: git question

Paul Franklin-5
On 1/18/14, Adam Stein <[hidden email]> wrote:
> You don't have to do the 2 git clone commands.  Git does automatically
> what you've been doing manually with svn.  When you commit in git, it
> doesn't go up to the repo like it does with svn.  You need to run 'git
> push' to go from your local repo to the remote one.

Yes, I know I "don't have to" do it the way I am trying
to see if I can do it.

Perhaps I didn't explain clearly enough that I /don't want/
to do a "git push" to the SourceForge repo.  Until I have
more faith in what I am doing, and (through repeated
trials and experiments) trust myself not to blow it.

Until then, how can I do a "git push" from my "slave"
local repo to my "master" local repo?  Everything I read
says it should be possible, so I assume that I just
haven't stumbled on the right set of commands yet.

Thanks.

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: git question

John Ralls-2

On Jan 18, 2014, at 7:19 PM, Paul Franklin <[hidden email]> wrote:

> On 1/18/14, Adam Stein <[hidden email]> wrote:
>> You don't have to do the 2 git clone commands.  Git does automatically
>> what you've been doing manually with svn.  When you commit in git, it
>> doesn't go up to the repo like it does with svn.  You need to run 'git
>> push' to go from your local repo to the remote one.
>
> Yes, I know I "don't have to" do it the way I am trying
> to see if I can do it.
>
> Perhaps I didn't explain clearly enough that I /don't want/
> to do a "git push" to the SourceForge repo.  Until I have
> more faith in what I am doing, and (through repeated
> trials and experiments) trust myself not to blow it.
>
> Until then, how can I do a "git push" from my "slave"
> local repo to my "master" local repo?  Everything I read
> says it should be possible, so I assume that I just
> haven't stumbled on the right set of commands yet.
>

Make your local master a bare repo: git clone --bare ssh://[hidden email]/p/gramps/source gramps-master
Then clone that for your working repo: git clone gramps-master gramps-working

Regards,
John Ralls



------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: git question

Paul Franklin-5
On 1/18/14, John Ralls <[hidden email]> wrote:
> Make your local master a bare repo: git clone --bare
> ssh://[hidden email]/p/gramps/source gramps-master
> Then clone that for your working repo: git clone gramps-master
> gramps-working

Thank you.

I haven't tried it yet but I believe that's the clue I
was looking for.

A related question becomes: is our SourceForge
repo a "bare" one (as I guess)?

Thanks.

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: git question

John Ralls-2

On Jan 18, 2014, at 7:40 PM, Paul Franklin <[hidden email]> wrote:

> On 1/18/14, John Ralls <[hidden email]> wrote:
>> Make your local master a bare repo: git clone --bare
>> ssh://[hidden email]/p/gramps/source gramps-master
>> Then clone that for your working repo: git clone gramps-master
>> gramps-working
>
> Thank you.
>
> I haven't tried it yet but I believe that's the clue I
> was looking for.
>
> A related question becomes: is our SourceForge
> repo a "bare" one (as I guess)?

Yes. All public repos are bare. git has a sensible rule that you can't push to a checked-out branch, so any working repo will have one branch that you can't push to. Bare repos have no checked out branch; they have only an object store, references, and hooks, so you can push to any branch.

Regards,
John Ralls


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: git question

Paul Franklin-5
Thanks again.

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: git question

Paul Franklin-5
I am continuing to learn how to use git.

While a bare repo is clearly what I need, I learned a "git
pull" can't be done in a bare repo and I need "git fetch".

The problem is (apparently) that a simple "git fetch" is not
enough (to download updates uploaded to the SourceForge repo
since I did the "git clone --bare").  I learned I needed:

  git fetch origin '+refs/heads/*:refs/heads/*'

(which was what http://stackoverflow.com/questions/10696718 said).

And then it added the extremely useful comment that:

  git config remote.origin.fetch '+refs/heads/*:refs/heads/*'

would enable me to only do a "git fetch" thereafter.

However, the git-fetch(1) manpage says:

  If the remote branch from which you want to pull is
  modified in non-linear ways such as being rewound and
  rebased frequently, then a pull will attempt a merge with
  an older version of itself, likely conflict, and fail. It
  is under these conditions that you would want to use the +
  sign to indicate non-fast-forward updates will be needed.

That paragraph is quite technical (to me) and so my question
to all of you is: since I am guessing our SourceForge repo
/won't/ be "modified in non-linear ways" do I really need the
plus-sign, the "+" in the above "git config" line?  I think
it is not needed (for me, for our repo).  Can you confirm?

Thanks.

------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: git question

John Ralls-2

On Jan 30, 2014, at 10:48 AM, Paul Franklin <[hidden email]> wrote:

> I am continuing to learn how to use git.
>
> While a bare repo is clearly what I need, I learned a "git
> pull" can't be done in a bare repo and I need "git fetch".
>
> The problem is (apparently) that a simple "git fetch" is not
> enough (to download updates uploaded to the SourceForge repo
> since I did the "git clone --bare").  I learned I needed:
>
>  git fetch origin '+refs/heads/*:refs/heads/*'
>
> (which was what http://stackoverflow.com/questions/10696718 said).
>
> And then it added the extremely useful comment that:
>
>  git config remote.origin.fetch '+refs/heads/*:refs/heads/*'
>
> would enable me to only do a "git fetch" thereafter.
>
> However, the git-fetch(1) manpage says:
>
>  If the remote branch from which you want to pull is
>  modified in non-linear ways such as being rewound and
>  rebased frequently, then a pull will attempt a merge with
>  an older version of itself, likely conflict, and fail. It
>  is under these conditions that you would want to use the +
>  sign to indicate non-fast-forward updates will be needed.
>
> That paragraph is quite technical (to me) and so my question
> to all of you is: since I am guessing our SourceForge repo
> /won't/ be "modified in non-linear ways" do I really need the
> plus-sign, the "+" in the above "git config" line?  I think
> it is not needed (for me, for our repo).  Can you confirm?
>

Probably rarely, but it's always possible that someone will screw up and force-push a non-linear change. One example of such would be pushing a change, realizing that one forgot to add a file, adding the file and, instead of creating a new commit amending the original, and then force-pushing.

The '+' is generally harmless and may save you some grief. I recommend that you use it.

Regards,
John Ralls



------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|

Re: git question

Paul Franklin-5
On 1/30/14, John Ralls <[hidden email]> wrote:
> The '+' is generally harmless and may save you some grief. I recommend that
> you use it.

That's exactly what I needed to learn.

Thanks.

------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel