[ImageJ-devel] GitHub for Mac, was Re: Copy Plugin directly to Plugins folder.

Johannes Schindelin Johannes.Schindelin at gmx.de
Thu Jun 27 16:31:11 CDT 2013


Hi Chris,

On Thu, 27 Jun 2013, Chris wrote:

> > > I need instructions on how to do steps B through E.
> > 
> > You already have the clone on your workstation. You wouldn't have been
> > able to push the README otherwise. You probably ran "git init" which
> > actually *creates* the repository on your workstation, and then you
> > ran "git push" which mirrors it back to GitHub. So you don't need to
> > clone in that case; you already have a copy of the repo, since the
> > workstation is where you created it.
> 
> OK, but I created the README on the website
> (https://github.com/ad1054/Postcards), not with a terminal command.

Yep, that was not exactly what that page said, was it? It can be fixed,
but it requires more effort on your side than if you had not created the
files on the website.

> When I then went through the instructions and tried to create the
> Hello-World README from the terminal, that's when I got the errors.

Multiple errors, because you had to understand the commands listed in the
article in order to adapt them to your particular case.

For one, your repository is not called Hello-World.

Another problem is that you did not know how to undo an already-run
command (git remote add ...).

> When I click the "clone in desktop" button on the github.com site, it
> takes me to the http://mac.github.com/ site where my only option is to
> download Git for Mac -- which I already downloaded.

... and which you could use as described on

	https://help.github.com/articles/working-with-repositories#cloning

to clone your own GitHub repository.

> > Step (D) is "git commit"

GitHub for Mac can help you do that, if you study the information conveyed in

	https://help.github.com/articles/making-changes

> > Step (E) is "git push"

This page has the information which you need to learn in order to use
GitHub for Mac to "push" (which they call synchronize because it is more
convenient than the "push" concept of Git what they do: they have a
two-way synchronisation between the remote repository and the local one).

	https://help.github.com/articles/making-changes#sync-your-changes-with-github

> > The book and other Git tutorials have more information.
> > 
> > You are already really close -- you have the code on your local
> > workstation, you have a GitHub repository already in existence, you
> > have a local Git repository linked to that remote repository, so all
> > you have to do is commit and push.
> > 
> > The errors you mentioned yesterday were because your local Git
> > repository had the wrong URL for the GitHub remote. That's why I asked
> > you to check the output of "git remote -v". It should say your origin
> > is "https://github.com/ad1054/Postcards". If it says "Hello-World"
> > that is wrong. To fix, try this:
> > 
> > git remote rm origin
> > git remote add origin https://github.com/ad1054/Postcards

Of course it is best if you understand that these commands work *inside*
one working directory that has remote information.

> This is the result of those commands in my terminal:
> 
> ChrisGAIAG:~ chris$ git remote rm origin
> fatal: Not a git repository (or any of the parent directories): .git

Well, what do you expect if you remove the 'origin' remote in your home
directory, which is not the working directory of the repository you
initialized with "git init"?

I told you in an earlier mail that each local repository lives in a .git/
subdirectory of the working directory. You created a Hello-World directory
and made it the working directory of a newly-initialized repository by
calling

	git init

*inside* Hello-World/. So that is where your Git information is: in
Hello-World/.git/.

Git will not try to guess what you mean if you are outside that directory.

> ChrisGAIAG:~ chris$ git remote add origin https://github.com/ad1054/Postcards
> fatal: Not a git repository (or any of the parent directories): .git

In general, it is a real bad idea to call the second command in any set of
instructions when the first one failed.

> So do I need to cd to some place first?

Actually, yes. As described above, Git has no chance of knowing what
project you want it to work on if you are outside the project's working
directory.

It is even what Git said:

	fatal: Not a git repository (or any of the parent directories): .git

Which is true, because I am sure that there does not exist a .git/
directory in your home directory.

> > Or, as Johannes says: just reclone from your GitHub remote into a new
> > directory, and then copy your files into there, and then commit and
> > push using the GitHub for Mac GUI.
> > 
> > Don't worry about "screwing anything up" because you can always just
> > delete and recreate the repository. It's not like you're going to lose
> > hundreds of hours of work, here.
> 
> The GitHub for Mac is a complete mystery right now.  There is a long
> list of my java classes and resources, followed at the end with a link
> to my NetBeans project folder, so I see there is a link to my computer.
> I guess I am in fact close.  I just need to figure out how to commit and
> push.  

Well, I think that understanding the information given in

	https://help.github.com/articles/making-changes

should help.

> And of course, resolve the strange errors in my project that can't
> recognize the Swing components of my jFrames when I removed the APC_
> class from my pom dependencies.  Now when I attempt to run it on my
> computer, I get this error:
> 
> Exception in thread "main" java.lang.NoClassDefFoundError: org/jdesktop/layout/GroupLayout$Group
> 	at A_Postcard.run(A_Postcard.java:25)
> 	at A_Postcard.main(A_Postcard.java:35)
> Caused by: java.lang.ClassNotFoundException: org.jdesktop.layout.GroupLayout$Group

Oh, that is a new piece of information. I was left under the impression
that you built and ran the project inside NetBeans. Apparently not so.

>  Also, when I was able to run my project, I get an error that it could
>  not find the class "Versatile Wand" which is in my project's
>  target>classes.  

So you *were* able to run your project in the meantime? I am sorry, but it
seems that I get incomplete information about the problems and the
progress on this side.

I fear that really, the only way forward that guarantees an efficient use
of your, Curtis' and my time, is to get familiar enough with Git or GitHub
for Mac so that you can publish exactly the files with which you have a
problem.

It is my failing that I do not understand from the descriptions what the
exact invocations and the exact error messages are, and therefore trying
to help you would only result in super-wild guesses that are unlikely to
assist you in fixing the issues.

The only way I could help effectively would be to be able to get at
exactly the same state where you are at, to be able to try to reproduce
your problem, and to fix it by way of a pull request (no need to fear, the
GitHub notification you receive will have detailed information that, when
read carefully, will equip you with everything you need to get back my
changes).

Ciao,
Johannes



More information about the ImageJ-devel mailing list