using git

A git repository is a sort of zip file. If you do git init in a folder, a folder .git is created inside that folder with a sort of zip file to keep the contents of the folder in. I'll call it a zip file for now, but it actually isn't a real zip file.

To add files to the zip file, you first have to stage the files with git add . (the dot is to add everything that is in the folder). You can see the list of staged files with git status. Use git rm --cached thefileto.unstage to unstage any unwanted files.

To put the staged files in the zip, use git commit -m 'a message about this change' . If you don't add -m and a message, you'll get a text to write the message in, just on the top line of the text is fine.

Setup Git

Set your user name email and github token

git --help :

usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [--html-path] [-p|--paginate|--no-pager] [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE] [--help] COMMAND [ARGS]

The most commonly used git commands are:

add Add file contents to the index

bisect Find by binary search the change that introduced a bug

branch List, create, or delete branches

checkout Checkout a branch or paths to the working tree

clone Clone a repository into a new directory

commit Record changes to the repository

diff Show changes between commits, commit and working tree, etc

fetch Download objects and refs from another repository

grep Print lines matching a pattern

init Create an empty git repository or reinitialize an existing one

log Show commit logs

merge Join two or more development histories together

mv Move or rename a file, a directory, or a symlink

pull Fetch from and merge with another repository or a local branch

push Update remote refs along with associated objects

rebase Forward-port local commits to the updated upstream head

reset Reset current HEAD to the specified state

rm Remove files from the working tree and from the index

show Show various types of objects

status Show the working tree status

tag Create, list, delete or verify a tag object signed with GPG

some commands:

git push : Update remote refs along with associated objects

EXAMPLES

git push

Works like git push <remote>, where <remote> is the current

branch’s remote (or origin, if no remote is configured for the

current branch).

git push origin

Without additional configuration, works like git push origin :.

The default behavior of this command when no <refspec> is given can

be configured by setting the push option of the remote.

For example, to default to pushing only the current branch to

origin use git config remote.origin.push HEAD. Any valid <refspec>

(like the ones in the examples below) can be configured as the

default for git push origin.

git push origin

Push "matching" branches to origin. See <refspec> in the

OPTIONS section above for a description of "matching" branches.

git push origin master

Find a ref that matches master in the source repository (most

likely, it would find refs/heads/master), and update the same ref

(e.g. refs/heads/master) in origin repository with it. If master

did not exist remotely, it would be created.

git push origin HEAD

A handy way to push the current branch to the same name on the

remote.

git push origin master:satellite/master dev:satellite/dev

Use the source ref that matches master (e.g. refs/heads/master) to

update the ref that matches satellite/master (most probably

refs/remotes/satellite/master) in the origin repository, then do

the same for dev and satellite/dev.

git push origin HEAD:master

Push the current branch to the remote ref matching master in the

origin repository. This form is convenient to push the current

branch without thinking about its local name.

git push origin master:refs/heads/experimental

Create the branch experimental in the origin repository by copying

the current master branch. This form is only needed to create a new

branch or tag in the remote repository when the local name and the

remote name are different; otherwise, the ref name on its own will

work.

git push origin :experimental

Find a ref that matches experimental in the origin repository (e.g.

refs/heads/experimental), and delete it.

there's also

git push origin +dev:master

but that's a dangerous one.

______________________________________________________________________________________________

When creating a new repository from the github website, I get this info:

Global setup:

Set up git

git config --global user.name "Peter Geirnaert"

git config --global user.email peter.geirnaert@gmail.com

Next steps:

mkdir YamahaCS2x_JSynthLib

cd YamahaCS2x_JSynthLib

git init

touch README

git add README

git commit -m 'first commit'

git remote add origin git@github.com:freqrush/YamahaCS2x_JSynthLib.git

git push -u origin master

Existing Git Repo?

cd existing_git_repo

git remote add origin git@github.com:freqrush/YamahaCS2x_JSynthLib.git

git push -u origin master

Importing a Subversion Repo?

Click here

When you're done:

Continue

______________________________________________________________________________________________

My current working directory with the files for the Roland SPD-11 support for JSynthLib is /home/peter/JSynthLib/synthdrivers/RolandSPD11

This my github page for the project: http://github.com/freqrush/RolandSPD11_JSynthLib

The clone URL is git://github.com/freqrush/RolandSPD11_JSynthLib.git

so to download all files, I enter this in the terminal:

git clone git://github.com/freqrush/RolandSPD11_JSynthLib.git

This is what I get:

Initialized empty Git repository in /home/peter/src/RolandSPD11_JSynthLib/.git/

remote: Counting objects: 38, done.

remote: Compressing objects: 100% (33/33), done.

remote: Total 38 (delta 9), reused 0 (delta 0)

Receiving objects: 100% (38/38), 16.14 KiB, done.

Resolving deltas: 100% (9/9), done.

Look what's inside the downloaded folder:

peter@FreqHost:~/src$ cd RolandSPD11_JSynthLib/

peter@FreqHost:~/src/RolandSPD11_JSynthLib$ ls

README.textile RolandSPD11

The RolandSPD11 folder is the actual folder you need, to put in /JSynthLib/synthdrivers/

when you want to test the drivers with your Roland SPD-11.

BE AWARE!!! THE WORKING AND ALMOST FINISHED VERSIONS OF THESE FILES ARE NOT YET ON GITHUB. (this is experimentalfrush after all ;)

This is what you'll get for now,

(until I get somebody writing a nice simple tutorial about using github to share simple code).

peter@FreqHost:~/src/RolandSPD11_JSynthLib$ cd RolandSPD11/

peter@FreqHost:~/src/RolandSPD11_JSynthLib/RolandSPD11$ ls

Instrument.java SPD11ChainDriver.java SPD11PatchDriver.java

PadInfo.java SPD11Constants.java SPD11PatchEditor.java

RolandSPD11Device.java SPD11PadDriver.java SPD11SettingsDriver.java

SPD11BankDriver.java SPD11PadEditor.java SPD11SystemDriver.java

(to be continued, and updated -> github)