First of all, this is just a walkthrough for Windows!
1. Download and install Git. I prefer the installation without msysGit
2. Install Git. Make sure you have admin rights (for example if you’re using the UAC). Here are my recommended settings:
3. Setup your git config. You should set at least the following two configuration settings:
git config -–global user.name “your name”
git config -–global user.email “your email”
You have to enter this commands in the Git Bash! After finishing, there should be a “.gitconfig” file in your user directory.
Here are some recommendations of mine. Feel free to just copy and paste it:
review = log -1 –patch
unstage = reset head
aa = add –all
au = add –update
s = status
p = pull
l = log –oneline -10
k = !gitk –all & –all &
aua = !git add –update && git commit –amend –reuse-message=HEAD
aaa = !git add –all && git commit –amend –reuse-message=HEAD
amend = commit –amend –reuse-message=HEAD
aucp = !sh -c ‚git add –update && git commit -m \"$1\" && git push‘ –
aacp = !sh -c ‚git add –all && git commit -m \"$1\" && git push‘ –
autosetupmerge = true
autosetuprebase = always
ui = auto
wtf = true
old = bold red
new = bold green
meta = bold yellow
current = black green
local = bold green
remote = yellow
plain = bold yellow
added = bold red
changed = bold green
untracked = bold cyan
nobranch = red reverse
prompt = bold green
error = bold red
4. Generate the RSA Keys by entering the following command in the bash shell:
ssh-keygen –C “your name” –t rsa –v
Be careful: Don’t enter a filename as it won’t generate the needed .ssh directory in your user dir! Read more in this article.
If the operation was successful, you will find the private and public keys in your user directory in the invisible direcotry “.ssh”. It’s important that the filenames are “id_rsa” and “id_rsa.pub” because Git is using by convetion these files to access the server.
5. Copy the “known_hosts” file from a co-worker and put it into your .ssh directory.
6. Add your public key to the remote git server. In my case, i have a local copy of the gitolite-admin directory on the server. So all i have to do is adding the new public key to the “keydir” directory and edit the “gitolite.conf” file in the “conf” directory:
7. Create a local copy of the development repository:
git clone git@ci:WebDevelopment.git
WebDevelpment.git is the name of the repository and ci is the server name. Make sure you are in the directory where you want to create the clone!
8. Some more references
9. Think about using symbolic links for the “.ssh” dir and the “.gitconfig” file. You can use the mklink command from windows. I use this way to sync all my machines.
Gefällt mir Wird geladen …