lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: git not fetching from origin...


From: Carl D. Sorensen
Subject: Re: git not fetching from origin...
Date: Sun, 24 May 2009 22:33:51 -0600



On 5/24/09 8:40 PM, "Mark Polesky" <address@hidden> wrote:

> 
> 
> Oh man, this is just way too frustrating.

It's OK, you're close.

> 
> Maybe it's a Windows thing, but nothing about git is clear to me
> anymore. I feel like I'm trying to learn from three different
> manuals, none of which quite work. Then I try out a couple of git
> commands in the bash shell and next thing I know, everything's
> corrupted...

But if it is corrupted, it's really easy to get it back.  I remember that it
was hard getting up to speed, but now it seems OK, at least for my common
tasks.

> 
> I guess I'm confused about the difference between origin and
> master. And the difference between pulling and fetching (and
> cloning, though that's not mentioned in the CG).

You've got it.  Origin is git.sv.gnu.org.  It is a git repository that has
lots of branches, and tags, and versions.  origin/master is the current
HEAD, or most recent commit on origin.  You can also have a master in your
local repository.

cloning sets up a local copy of the remote repository, which is
traditionally called origin (you could call it something else if you wanted
to, but by calling it origin, all the examples seem to work right).

One confusing thing is that there is no firm name attached to
git.sv.gnu.org.  When you create a git repository, you also create a remote
which is a local data entry that points to git.sv.gnu.org.  So although you
think of it as being on savannah, the pointer is actually on your machine.

Fetch gets copies of the files from a remote (usually origin).

Pull gets copies of the files from a remote and merges them with a local
branch.

Pull is the equivalent of fetch followed by merge.

I never fetch, only pull.
> 
> If I accidentally make changes to master, and I try to pull from
> origin, it says it's already up to date. I assumed origin was
> supposed to be at git.sv.gnu.org, so does that mean I accidentally
> made my local master the origin? Is there even such a thing as a
> local master?

If you make changes to master, and don't commit them, then pull, it will be
already up to date because the changes were never committed.  The proper way
to undo the changes that you've made but never committed, is to do

git checkout master

which gets clean copies of the files on the master branch from the
repository and puts them in your working directory.

Once you have changes to your files that you like, you do

git commit -a

which copies the changed files to the repository, along with a commit
message.

Now my terminology here may not be "git approved", but it's how I understand
things.

You can never make changes to origin/master, because you don't have push
access.  Even if you did have push access, you'd have to execute a git push
command in order to make those changes.  I promise you, you can't ruin
origin, no matter what you do.

Yes there is (or can be) a local master.  If you run the gitk program, it
will show you the local master.

> 
> And how do I exit the EDIT_COMMITMSG window? I've included an
> image showing the window. If I click on the X button, the whole
> git bash shell closes along with it. That can't be right. And when
> did my lily-local get ahead of origin/master by 47 commits?

Most likely the EDIT_COMMITMSG window is a vi or vim equivalent editor.
I'd suggest that you try the following.

1) move your cursor to a blank line (I generally do it at the top).

2) type i to enter input mode.

3) Type in a one-sentence commit message

4) Hit the escape key

5) Type :wq, which will write the changes and quit the editor.

That will complete your commit.


I have no idea how lily-local got ahead of origin master by 47 commits.  If
I were you, I'd save the files you've changed in some other directory,
delete your local git repository, and start over.


> 
> I think the instructions in the CG just aren't clear enough. Is
> anyone out there happily making git patches on Windows? Let me
> know!

I believe that Patrick McCarty is happily making git patches on Windows, and
perhaps Andrew Hawryluk, as well.

I'm sorry about the difficulty of getting up to speed on this.  It's one of
those things that is really hard to get (I remember struggling with it), and
then once it clicks in, you wonder why it was so hard.

If the CG instructions don't work (and obviously they haven't for you),
you'd be helping others if you could point out the problems you had in
following the CG instructions show we can improve them.

Thanks for being willing to take this on.  I know it's frustrating.  You
want to do some real work, and instead of doing real work you're mucking
around getting lost in some arcane program that doesn't seem to work right,
and you can't even ask a question because you don't know what to ask.  But
once you get it figured out, it will be better, I promise.

HTH,

Carl





reply via email to

[Prev in Thread] Current Thread [Next in Thread]