命令格式

git add [--verbose | -v] [--dry-run | -n] [--force | -f] [--interactive | -i] [--patch | -p]
    [--edit | -e] [--[no-]all | --[no-]ignore-removal | [--update | -u]]
    [--intent-to-add | -N] [--refresh] [--ignore-errors] [--ignore-missing]
    [--] [<pathspec>…​]

 

命令参数

--verbose, -v
  详细模式。

 

实例

a) 添加文件至暂存区

[huey@huey-K42JE hello_git]$ date > datetime.txt
[huey@huey-K42JE hello_git]$ git add datetime.txt 

b) 添加当前目录的所有文件至暂存区

[huey@huey-K42JE hello_git]$ mkdir src
[huey@huey-K42JE hello_git]$ echo -e '#!/usr/bin/python\nprint "hello world"' > src/hello.py
[huey@huey-K42JE hello_git]$ git add .

 

更多

http://git-scm.com/docs/git-add

 

相关文章:

  • 2021-09-08
  • 2021-12-31
  • 2021-08-29
  • 2021-08-06
  • 2022-12-23
  • 2021-09-08
  • 2022-12-23
  • 2021-06-25
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-26
  • 2022-12-23
  • 2022-12-23
  • 2021-09-08
  • 2021-12-20
相关资源
相似解决方案