Git: Unterschied zwischen den Versionen

Aus robopagex.com
Zur Navigation springen Zur Suche springen
 
(14 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 4: Zeile 4:
  
 
[Git, free and open source https://git-scm.com/]
 
[Git, free and open source https://git-scm.com/]
 +
 +
 +
<big>'''''Tutorial's'''''</big>
 +
 +
 +
'''[https://training.github.com/downloads/de/github-git-cheat-sheet/ Git Cheat Sheets German]'''
 +
 +
 +
'''[https://git-scm.com/docs git Reference]'''
 +
 +
 +
'''[https://git-scm.com/book/en/v2 git Book]'''
 +
 +
 +
'''[https://youtu.be/6uvzIMdqV2U Git-Grundlagen für Entwickler - Alles was man zum Einstieg wissen muss | Thomas Claudius Huber]'''
 +
 +
 +
'''[https://www.youtube.com/watch?v=GOX1C1qdSys Wie man mit Git richtig produktiv wird | Michael Kaufmann]'''
 +
  
  
Zeile 17: Zeile 36:
  
 
     '''git config user.email "mail@example.com"'''
 
     '''git config user.email "mail@example.com"'''
 +
 +
    '''git config --global --edit'''
  
 
     '''cat .git/config'''
 
     '''cat .git/config'''
 +
  
 
''Create empty/new repository or reinitialize an existing repository'':
 
''Create empty/new repository or reinitialize an existing repository'':
Zeile 26: Zeile 48:
  
 
''Show repository/dir status'':
 
''Show repository/dir status'':
 +
 
 
   '''git status'''
 
   '''git status'''
 +
 +
''Show log status'':
 +
 
 +
  '''git log'''
 +
 +
  '''git log --stat'''
 +
 +
  '''git log --oneline'''
 +
 +
  '''git log --oneline --decorate'''
 +
 +
  '''git log -n 1'''
 +
 +
  '''git log --after "2020-09-01"'''
 +
 +
  '''git log --before "2020-09-01"'''
  
 
''Show os language and change it temporarily''
 
''Show os language and change it temporarily''
Zeile 45: Zeile 84:
  
 
   '''git add testfile'''
 
   '''git add testfile'''
 +
 +
  '''git add .'''
 +
  ''add all "files/directories" from current directory''
 +
 +
  '''git reset HEAD filename'''
 +
  ''remove file from StageArea''
  
 
''Remove file or directory from "StageArea"''
 
''Remove file or directory from "StageArea"''
Zeile 52: Zeile 97:
 
''Remove and delete file or directory from "StageArea and Filesystem"''
 
''Remove and delete file or directory from "StageArea and Filesystem"''
 
   '''git rm -f filename'''
 
   '''git rm -f filename'''
 +
 +
''Commit file or directory to branch''
 +
 +
  '''git commit'''
 +
  ''add message manually''
 +
 +
  '''git commit -m "Message for commit"'''
 +
 +
  '''git commit --amend --reset-author'''
 +
  ''change commit author''
 +
 +
  '''git commit -am "Message for commit"
 +
 +
  '''
 +
 
 +
''Create ignore file''
 +
 +
  '''nano|touch|vi .gitignore'''
 +
 +
<big>'''''Branches'''''</big>
 +
 +
''Show Branch''
 +
 +
  '''git branch'''
 +
 +
  '''git branch -d NAME'''
 +
  ''delete branch''
 +
 +
  '''git branch -d NAME1 NAME2 MORE'''
 +
  ''delete 2 or more branches''
 +
 +
  '''git branch -D NAME'''
 +
  ''force delete branch''
 +
 
 +
  '''git branch --merged'''
 +
 +
  '''git branch --no-merged'''
 +
 +
<big>'''''checkout'''''</big>
 +
 +
  '''git checkout NAME'''
 +
 +
  '''git checkout -b'''
 +
 +
 +
<big>'''''merge'''''</big>
 +
 +
  '''git merge NAME'''
 +
  ''normal merge without errors''
 +
 +
  '''git merge --abort'''
 +
 
 +
 +
  '''git checkout'''

Aktuelle Version vom 24. September 2020, 10:55 Uhr

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Git is easy to learn and has a tiny footprint with lightning fast performance. It outclasses SCM tools like Subversion, CVS, Perforce, and ClearCase with features like cheap local branching, convenient staging areas, and multiple workflows.

[Git, free and open source https://git-scm.com/]


Tutorial's


Git Cheat Sheets German


git Reference


git Book


Git-Grundlagen für Entwickler - Alles was man zum Einstieg wissen muss | Thomas Claudius Huber


Wie man mit Git richtig produktiv wird | Michael Kaufmann


Set global username/email:

   git config --global user.name "NAME"
   git config --global user.email "mail@example.com"

Set repository-specific username/email:

   git config user.name "NAME"
   git config user.email "mail@example.com"
   git config --global --edit
   cat .git/config


Create empty/new repository or reinitialize an existing repository:

   git init
   Initial commit is the first commit at Branch Master

Show repository/dir status:

  git status

Show log status:

  git log
  git log --stat
  git log --oneline
  git log --oneline --decorate
  git log -n 1
  git log --after "2020-09-01"
  git log --before "2020-09-01"

Show os language and change it temporarily

  echo $LANG
  export LANG="en_US.UTF-8

Create new empty file

  nano testfile
  touch testfile
  vi testfile

Add file or directory to "StageArea"

  git add testfile
  git add .
  add all "files/directories" from current directory
  git reset HEAD filename
  remove file from StageArea

Remove file or directory from "StageArea"

  git rm --cached filename

Remove and delete file or directory from "StageArea and Filesystem"

  git rm -f filename

Commit file or directory to branch

  git commit
  add message manually
  git commit -m "Message for commit"
  git commit --amend --reset-author
  change commit author
  git commit -am "Message for commit"
  
  

Create ignore file

  nano|touch|vi .gitignore

Branches

Show Branch

  git branch
  git branch -d NAME
  delete branch
  git branch -d NAME1 NAME2 MORE
  delete 2 or more branches
  git branch -D NAME
  force delete branch
  
  git branch --merged
  git branch --no-merged

checkout

  git checkout NAME
  git checkout -b


merge

  git merge NAME
  normal merge without errors
  git merge --abort
  
  git checkout