GIT How To

Summary

Here's a brief overview of the steps detailed below for using git with FreeEMS

  • Create SSH connection using agent
  • sign up for a free account with github
  • fork off a branch of the code
  • clone the project you forked off, getting your self a local copy
  • study and make changes
  • push your changes back up to github to allow others to see

Windows XP

mostly coppied from http://www.diyefi.org/forum/viewtopic.php?f=41&t=547

get git, my file was :

Git-1.5.6.1-preview20080701.exe       ** Full installer if you want to use official Git 1.5.6.1 **    Beta Featured

install it

make a directory for your stuff

right click, “git bash here”

generate your key :

fcooke@CALLVIEW-GW ~/Desktop/tuner
$ ssh-keygen -C fred.cooke@gmail.com -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Documents and Settings/fcooke/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Documents and Settings/fcooke/.ssh/id_rsa.
Your public key has been saved in /c/Documents and Settings/fcooke/.ssh/id_rsa.pub.
The key fingerprint is:
19:8d:c0:b2:39:1a:64:4f:06:97:48:54:69:9b:d5:0d fred.cooke@gmail.com

run the agent :

fcooke@CALLVIEW-GW ~/Desktop/tuner
$ eval `ssh-agent`
Agent pid 2956

add the key to the agent :

fcooke@CALLVIEW-GW ~/Desktop/tuner
$ ssh-add
Identity added: /c/Documents and Settings/fcooke/.ssh/id_rsa (/c/Documents and Settings/fcooke/.ssh/id_rsa)

configure username, email, github username, github id thingy

fork the repo on github

run clone on private url to local dir

profit?

TBC, have to get some things done…

Here's an example from another project http://kylecordes.com/2008/04/30/git-windows-go/


Linux FC8

get git,

# yum install git

git requires a key for it's ssh connection so generate your key (blank passwords don't play nice) :

$ ssh-keygen -C email@email.com -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/user/.ssh/id_rsa. 
Your public key has been saved in /home/user/.ssh/id_rsa.pub.
The key fingerprint is:
11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff:11 email@email.com
$

run the agent :

$ cd /home/user/freeEMS/git-copy/
$ eval `ssh-agent`
Agent pid 13006
$

add the key to the agent :

$ ssh-add
Identity added: /home/user/.ssh/id_rsa (/home/user/.ssh/id_rsa)
Enter passphrase for /home/user/.ssh/id_dsa:
$

Sign up for a free account with github, do it here and match the e-mail and pass noted above, also have the fingerprint ready.

Here's a link to primary FreeEMS tuner http://github.com/srynot4sale/freeems-tuner/tree/master

Here's a link to primary FreeEMS firmware http://github.com/fredcooke/freeems-vanilla/tree/master

insert picture here showing where to copy the fingerprint / token thing

https://github.com/signup/free

Now configure git, remember to change the username, email address and fingerprint

$ git config --global user.name "username"
$ git config --global user.email email@email.com
$ git config --global github.token 112233445566778899aabbccddeeff11
$ git config --global github.username "username"
$

Fork the repo on github. Go to http://github.com/srynot4sale/freeems-tuner/tree/master and after signing in, click the fork button. This will create a fork for your user name.

insert picture here showing what it should look like when you fork

Now clone the repo to get a local copy. This one is for the tuner software

$ git clone git@github.com:username/freeems-tuner.git
Initialized empty Git repository in /home/user/freeEMS/git-copy/freeems-tuner/.git/
Enter passphrase for key '/home/user/.ssh/id_rsa':
remote: Counting objects: 571, done.
remote: Compressing objects: 100% (559/559), done.
Indexing 571 objects...
remote: Total 571 (delta 322), reused 0 (delta 0)
 100% (571/571) done
Resolving 322 deltas...
 100% (322/322) done
$ ls -la
total 16
drwxrwxr-x  4 user user 4096 2008-12-29 05:47 .
drwxrwxr-x 20 user user 4096 2008-12-28 16:49 ..
drwxrwxr-x  9 user user 4096 2008-12-29 05:47 freeems-tuner
$

After you fork the firmware, clone it like this

$ git clone git@github.com:username/freeems-vanilla.git
Initialized empty Git repository in /home/user/freeEMS/git-copy/freeems-vanilla/.git/
Enter passphrase for key '/home/user/.ssh/id_rsa':
remote: Counting objects: 369, done.
remote: Compressing objects: 100% (288/288), done.
Indexing 369 objects...
remote: Total 369 (delta 163), reused 169 (delta 28)
 100% (369/369) done
Resolving 163 deltas...
 100% (163/163) done
$

You can also clone it and include the dir in the command. Something simalar to this would have done about the same thing

$ git clone git@github.com:username/freeems-vanilla.git /home/user/freeEMS/git-copy/

Now you have a local copy of that code. You can study it and make changes. Once you're ready you can “git commit” which may require ”git add” this prepares you local copy. Then you “git push” to make it visable to others. If the master branch likes it, then can merge branches.

Other items that may be of interest include (the below is not for FreeEMS, it's copied from a tutorial)

git remote add harry git@github.com:harrycordes/odtimetracker.git

As usual, use reasonable names and relevant URLs, not my sample names and URLs. Once you’ve added the remote reference, pushing is easy:

git push harry master
 
git-howto.txt · Last modified: 2008/12/31 11:11 by jharvey
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki