cmdref.net - Command Reference

This site is command references for system engineers.

User Tools

Site Tools


Top     SiteMap

Sidebar

Top     SiteMap








Etc


Reference












.

middleware:version-control:git:index.html



Middleware

Git

summary

  • Git is a distributed revision control and source code management (SCM) system.
  • Git is a version control system (VCS) for tracking changes in computer files and coordinating work on those files among multiple people.

Web Sites

Companies & Projects Using Git

Google, facebook, Microsoft, twitter, Linux, eclipse

Git Image




Command

Configuration

Command Explanation Example
git --version Disaplay git version
git config --list
git config user.name


User

~]$ git config --global user.name XXXXX
~]$ git config --global user.email xxxx@xxxx.xxx
~]$ git config --global --list   <- check
~]$ cat ~/.gitconfig


Setting Up a Git Repository

Command Explanation Example
git init Create an empty Git repository or reinitialize an existing one git init --bare project1
git clone git clone project1 testclone


Daily Work

Command Explanation Example
git add Add file contents to the index git add test.txt
git add -p ← all files of changed
git add . ← new add and edit files
git add -u ← delete files, edit files, not new files
git add -all or git add -A ← both . and -u
git rm git rm -f test.txt
git commit Record changes to the repository git commit -m “message”
git commit -a
git status Show the working tree status
git diff
git log Show commit logs git log
git log --until=2017-01-18 / git log --before=2017-10-15
git log --after=2017-01-20 / git log --since=2017-10-15
git log --grep='XXXX'
git log --oneline
git log --graph --decorate --oneline
git checkout git checkout .
git checkout -f master
git revert git revert HEAD
git reset
git clean Remove untracked files from the working tree git clean -n ← check only(dispalay a deleting files. not delete)
git clean -df ← directory adn file
git clean -xf


Branch

Command Explanation Example
git branch -a Check Branch
git branch NEW Crate Branch
git checkout NEW Change Branch







middleware/version-control/git/index.html.txt · Last modified: 2018/02/16 by admin