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

Johannes Schindelin Johannes.Schindelin at gmx.de
Thu Jun 27 16:09:22 CDT 2013


Hi Chris,

On Thu, 27 Jun 2013, Chris wrote:

> > >  following the instructions at
> > >  https://help.github.com/articles/fork-a-repo doesn't work .
> > 
> > The article you want is:
> > https://help.github.com/articles/create-a-repo
> 
> I did this article and created the README yesterday, which created a
> Hello-World folder on my computer with a .git and a README file.  I
> couldn't commit or push the commit due to the errors I sent you
> yesterday (remote origin already exists).  But that article is only
> about creating a repo and creating and pushing a README file.  It says
> nothing about cloning to my local workstation.

This was meant to help you on the notion that you have familiarized
yourself with Git a bit rather than following the instructions in the
create-a-repo article slavishly.

Although, you most likely did not follow the article *all* that slavishly.
Since you already had the 'origin' remote, there is no way that you
followed step 1:

	mkdir ~/Hello-World
	cd ~/Hello-World
	git init
	touch README

followed by step 2:

	git add README
	git commit -m 'first commit'

followed by step 3:

	git remote add origin https://github.com/username/Hello-World.git
	git push origin master

Besides, in your mail you indicated that you really copy-pasted that "git
remote" command a couple of times. It will fail from the second time on.

Further, you should not have followed those instructions mindlessly: since
you did *not* create a repository on GitHub called 'Hello-World' as they
suggest before step 1, but rather a repository called 'Postcards', the
'git remote' call in step 3 should of course specify a URL ending in
Postcards.git, not in Hello-World.git.

> > *not* the one on forking a repo. The forking article is when you want
> > to make a copy of someone *else's* repository and work on your copy of
> > it. In your case, it is your own repo that you control. So you need
> > to:
> > A) create the repo on GitHub (you did this already)
> > B) clone it to your local workstation (that's what "git clone" does;
> > you can also do it via GitHub for Mac or other UI)
> > C) hack on the local copy on your workstation
> > D) commit your changes, which is like taking a snapshot so you don't
> > lose work
> > E) push your commits back to the remote server, so others can see what
> > you did
> > 
> > Pushing your changes back to GitHub is also nice in case your computer
> > explodes, so you don't lose any work. You won't even lose the
> > *history* of your work since the entire thing is there on the server.
> > (And the entire thing is there on you local workstation -- that's why
> > it's called a "clone").
> 
> I need instructions on how to do steps B through E.

The page I linked to yesterday has detailed instructions on step B at
least. And I would really be surprised if they did a bad job for steps C,
D and E.

So I am looking at http://mac.github.com/help.html now.

"Cloning a repository" sounds like it might be covered in "Working with
repositories":

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

And sure enough, "cloning" is handled here:

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

In the section after "Cloning", called "Celebrate", there is a link to
learn how to "make changes and commit them" which is suspiciously close to
what Curtis referred to as C and D, respectively:

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

A-ha! Indeed, the first part of that page shows you how to open the
working direcory of the just-cloned repository in the Finder! That's good!
So now, you could make changes to that directory.

Including copying the files and directories from the directory that
contains your Postcards project.

Now, I never used GitHub for Mac, but I conjecture that those files would
show up as "untracked" files that GitHub for Mac lets you add to the
repository ("track") and commit.

As to D, I think that http://mac.github.com/help.html#faq-sync-push-pull
should answer that question (FWIW I went back to the first help page of
GitHub for Mac, which is something you could always do if you do not find
the information you seek on another page).

> > > I'm still lost and do not want to start trying things without
> > > knowing what I'm doing.
> > 
> > I strongly suggest you take the time to read up on Git so that you
> > have a basic understanding before you flail around too much. It will
> > save you a lot of frustration.
> > 
> > http://git-scm.com/book
> 
> Thanks, Curtis, I will definitely study this.

There is also the very informative GitHub channel with tons of screencasts:

	https://www.youtube.com/playlist?list=PL0lo9MOBetEFXG2IOr4As-8IZPOBYs3Jf

In particular, I would suggest looking at

	https://www.youtube.com/user/GitHubGuides

"Git Basics" and "GitHub Overview" are probably the most important for you.

Ciao,
Johannes



More information about the ImageJ-devel mailing list