Difference between revisions of "Git"

From Teknologisk videncenter
Jump to: navigation, search
m
m (Basic configuration)
Line 8: Line 8:
 
heth@emb3:~$ git config --global user.email "heth@mercantec.dk"
 
heth@emb3:~$ git config --global user.email "heth@mercantec.dk"
 
</source>
 
</source>
 +
=File tracking Lifecycle=
 +
A specified file can be in one of four states
 +
{|border=1 ;style="margin: 0 auto; text-align: center;cellpadding="5" cellspacing="0"
 +
|- bgcolor=lightgrey
 +
! State !! Explanation
 +
|-
 +
|Untracked||The file is '''not''' tracked by git and changes are not recorded
 +
|-
 +
|Unmodified||The file is tracked by git and is not changed since it's last '''commit'''
 +
|-
 +
|Modified||The file is tracked by git and has changed since it's last '''commit'''
 +
|-
 +
|Staged||means that you have marked a modified file in its current version to go into your next commit snapshot.
 +
|-
 +
|}
  
 +
 +
 +
[[Image:Tracking Files Learn Git in 3 Hours.png|700px|center]]
  
 
=Why is it called Git?=
 
=Why is it called Git?=

Revision as of 16:41, 19 December 2022

Install git

Download git from https://git-scm.com/download/win and install it.

Basic configuration

From terminal issue the following commands: (Windows start the git bash app)

heth@emb3:~$ git config --global user.name "Henrik Thomsen"
heth@emb3:~$ git config --global user.email "heth@mercantec.dk"

File tracking Lifecycle

A specified file can be in one of four states

State Explanation
Untracked The file is not tracked by git and changes are not recorded
Unmodified The file is tracked by git and is not changed since it's last commit
Modified The file is tracked by git and has changed since it's last commit
Staged means that you have marked a modified file in its current version to go into your next commit snapshot.


Tracking Files Learn Git in 3 Hours.png

Why is it called Git?

Linus Torvalds has quipped about the name "git", which is British English slang for a stupid or unpleasant person. Torvalds said: "I'm an egotistical bastard, and I name all my projects after myself. First 'Linux', now 'git'."[1][2][3]

References