GIT - Users Manual ( The Short Version )
Some very interresting books about installing GIT:
http://book.git-scm.com/index.html
http://progit.org/book/
Installation
Windows-Client:
Here is the main website of the Git-repo where you can find the binairies and the source code for the real h4xx0r5 amongst us: http://code.google.com/p/msysgit/
Download the latest version of Git using the following website: http://code.google.com/p/msysgit/downloads/list
After GIT has been installed you will need a SSH-key!
This is for securing your connection between you and the server.
Creating this key is created by typing this command:
ssh-keygen -C "username@email.com" -t rsa(with your own email address, of course)
Accept the default key file location. When prompted for a passphrase, make one up and enter it.
If you feel confident that your own machine is secure, you can use a blank passphrase, for more convenience and less security. Note where it told you it stored the file.
On the machine I tested with, it was stored in “C:\Documents and Settings\Matthijs\.ssh\”
If the file is not there, just do a find on :"id_rsa.pub" it will then point you to the correct location.
Then open the file id_rsa.pub with a text editor. The text in there is your “public SSH key”.
You will need it to set up your GitHub account, in the next section.
* Beware of $HOME trouble: a reader reported a tricky failure mode in which some other software he installed had set up a HOME or HOME_PATH environment variable pointing in to that application instead of to your real home (“Documents and Settings”) directory.
After doing these things you need to be added to the project! Therefore the project manager needs your credentials for the project, so send him an email or kick his ass! :)
Upload your ssh-key to the beanstalk.
When you've got an account and uploaded your key you need to make a folder where you want to download the stuff. Then right-click on that folder and open Git-bash here. Then do the following commands.
git pull origin master
There you go! Now you've got all the files needed.
When you've made changes or added files to the project you need to let the server know that there are changes
Ubuntu-Server:
https://help.ubuntu.com/community/Git
http://www.hackido.com/2010/01/installing-git-on-server-ubuntu-or.html
Commands, Tips 'n Tricks
Reference http://ariejan.net/2008/04/23/git-using-the-stash/
Git Stack
I bet the following has happened to you: you are happily working on a project and are in the middle of something. You are not ready to commit your changes, because you your tests don’t pass yet. Then your client calls with a bug report that needs to be fixed right now. (You know how clients can be.)
So, what do you do? Throw away your current changes to make the patch? Checkout a clean copy of your project to make the changes? No! You just stash your changes away, and make the patch! Afterward you grab your changes back and continue work.
Git features The Stash, which is as much as a good place to store uncommitted changes. When you stash you changes, the will be stored, and your working copy will be reverted to HEAD (the last commit revision) of your code.
When you restore your stash, you changes are reapplied and you continue working on your code.
Stash your current changes
$ git stash save
Saved "WIP on master: e71813e..."List current stashes
Yes, you can have more than one!! The stash works like a stack. Every time you save a new stash, it’s put on top of the stack.
$ git stash list
stash@{0}: WIP on master: e71813e...
Note the stash@{0} part? That’s your stash ID, you’ll need it to restore it later on. Let’s do that right now. The stash ID changes with every stash you make. stash@{0} refers to the last stash you made.
Apply a stash
$ git stash apply stash@{0}
You may notice the stash is still there after you have applied it. You can drop it if you don’t need it any more.
$ git stash drop stash@{0}
Or, because the stash acts like a stack, you can pop off the last stash you saved:
$ git stash pop
If you want to wipe all your stashes away, run the ‘clear’ command:
$ git stash clear
It may very well be that you don’t use stashes that often. If you just want to quickly stash your changes to restore them later, you can leave out the stash ID.
$ git stash
...
$ git stash pop
.gitignore
If you create a file in your repo named .gitignore git will use its rules when looking at files to commit. Note that git will not ignore a file that was already tracked before a rule was added to this file to ignore it. In such a case the file must be un-tracked, usually with git rm --cached filename
This file can be committed into the repo, thus sharing the rule list with any other users that clone the repo.
Note that you can create a .gitignore in any subpath to have its rules applied at that path. Sometimes an empty .gitignore file is used as a placeholder for an empty path, for example to force git to generate a log/ path for your development environment to use.