Getting set up on github

FreeEMS topics that aren't specific to hardware development or firmware development.
User avatar
jharvey
1N4001 - Signed up
Posts: 1607
Joined: Tue Jun 10, 2008 5:17 pm

Re: Getting set up on github

Post by jharvey »

So here are some snap shots of TortiseGIT showing how to setup your authentication.

First got to settings.

Image

Then choose remote settings. The default is origin, here's how mine looks. Also it's easy to "add new", but it's a bit harder to remove junk, so getting it right might be handy. Or modifying an existing one instead of created several might also be handy. Basically choose your names how you want them on the first try.

Image

Also go to the config area. Here's how mine looks. This is required to make you have your name when you check it in.

Image

Here's the key generated by putty.

Image

Here's how it looks in github. Note I stripped a bunch of the file out, and I added the ssh-rsa thing with the space at the end of ssh-rsa. It needs to look this way when you open the key.

Image

After that, you should have read / write access to you account. Of course you'll have to change the jharvey stuff with your account, because you you'll only have read access to my account.
User avatar
jharvey
1N4001 - Signed up
Posts: 1607
Joined: Tue Jun 10, 2008 5:17 pm

Re: Getting set up on github

Post by jharvey »

I just added the picture of the config setting in the post above.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Getting set up on github

Post by Fred »

viewtopic.php?f=41&t=1103

If you're trying to contribute, this is a guide on how to be polite about it!

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Getting set up on github

Post by Fred »

A great little diagram about the way files move between their four possible states in Git:

Image

If this image doesn't display here, PM me and I'll cache it.

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
johntramp
LQFP112 - Up with the play
Posts: 119
Joined: Sat Apr 24, 2010 1:42 am
Location: New Zealand

Re: Getting set up on github

Post by johntramp »

Doesn't an untracked file get added to the staging area?
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Getting set up on github

Post by Fred »

That is one possibility, yes. I think for the sake of clarity of ideas he has opted to display a different process. I like how clear it is. I didn't understand the 4 states for quite a long time, this would have helped.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Getting set up on github

Post by Fred »

A variation on the diagram from the git book, which I don't agree with, and think is misleading and unclear.

Image

Explanation:
  • On the left are files that are not known to git. New files. Files that have not been committed in the past, or have since been removed.
  • Next to that is the normal default state of a committed and tracked git file.
  • To the right of that is the same file, modified, and showing a dirty status.
  • Finally, on the right is a staging area, where you MUST add new files, and where you CAN add existing modified files.
The original file is misleading in that:
  1. It shows adding a new file as making it tracked, when really, it's just staged, and not committed. Sure, git knows about it, but not in a permanent/semi-permanent way.
  2. It doesn't show adding a new file as being staged and ready to commit, implying that it's committed by adding it.
  3. It doesn't show that you can commit from the modified state without staging anything.
Additionally, mine doesn't show that you can remove something from being staged instead of committing it. Insert a big grey line from right to left at the bottom in your mind.

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
johntramp
LQFP112 - Up with the play
Posts: 119
Joined: Sat Apr 24, 2010 1:42 am
Location: New Zealand

Re: Getting set up on github

Post by johntramp »

Here the commit from modified to unmodified is wrong too...? Sure, a commit -a can do it in one step, but that is still staging the files.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Getting set up on github

Post by Fred »

No, it's correct.

git commit README.md

Works just fine. But fails if README.md is brand new. Have to add first in this case.

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
Post Reply