01 初识 Git

2182阅读 0评论2012-08-13 Garfield_Trump
分类:项目管理

1,init repository
  1. mkdir demo
  2. cd demo
  3. git init
2,configure repository information

  1. git config user.name "Garfield Trump"
  2. git config user.email
3,query repository config information

  1. git config -e
  2. git config -e --global
  3. git config -e --system
  4. cat .git/config
4,add file into repository

  1. echo "Hello." >> welcome.txt
  2. git add welcome.txt
  3. git status
  4. git status -s
  5. git commit -m "initialized"
  6. git status
  7. git status -s
5,query repository information of path

  1. mkdir -p a/b/c
  2. cd a/b/c
  3. git rev-parse --git-dir
  4. git rev-parse --show-toplevel
  5. git rev-parse --show-prefix
  6. git rev-parse --show-cdup
6,show repository log

  1. git log
  2. git log --pretty=fuller
7,clone repository

  1. cd /path/to/my/workspace
  2. git clone demo demo1





 
 
 


 
上一篇:Linux 程序开发打印 Debug 信息的使用技巧
下一篇:02 Git 暂存区的理解