Git: Unterschied zwischen den Versionen

Aus robopagex.com
Zur Navigation springen Zur Suche springen
Zeile 52: Zeile 52:
 
''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''

Version vom 16. September 2020, 21:49 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/]


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"
   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 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

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