Git/Tutorial: Difference between revisions

From Medien Wiki
(Created)
 
Line 10: Line 10:
== 2. Setup ==
== 2. Setup ==


With other revisioning systems, it can be quite a hassle to create an initial setup for a folder, with git this is really easy. Just open up your shell, change the directory to the directory you wish to use git and type:
'''If you're using git for the first time''', you might want to setup some configuration settings:
 
  git config --global user.name "Max Mustermann"
  git config --global user.email max@mustermann.de
 
These two settings help to identify you when you're pushing your files to a remote server.
 
Git can produce colorful output with some commands; since some people hate colors way more than the rest likes them, by default the colors are turned off. If you would like to have colors in your output:
 
  git config --global color.diff auto
  git config --global color.status auto
  git config --global color.branch auto
 
These settings are global (for your machine), so you only need to do this once.


<source lang="bash">cd myProjectPath
git init</source>


== Adding a Remote git Server ==


To add a remote git server, type:
To add a remote git server, type:
Line 23: Line 35:


But remember, you can use git only on your local computer as well, it is not required to have an online server!
But remember, you can use git only on your local computer as well, it is not required to have an online server!
Create or select a folder ("myProject") and change the current directory with the bash command <tt>cd</tt>
<source lang="bash">cd myProjectPath
git init</source>


== Usage ==
== Usage ==