@Sarah
2015-05-24T08:40:04.000000Z
字数 2538
阅读 1312
未分类
在此输入正文
//打开终端
Last login: Sun May 24 09:02:37 on console
appledeMacBook-Pro:~ apple$ git
xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.
appledeMacBook-Pro:~ apple$ git
usage: git [--version] [--help] [-C <path>] [-c name=value]
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
<command> [<args>]
The most commonly used git commands are:
//常用命令
add Add file contents to the index
bisect Find by binary search the change that introduced a bug
branch List, create, or delete branches
checkout Checkout a branch or paths to the working tree
clone Clone a repository into a new directory
commit Record changes to the repository
diff Show changes between commits, commit and working tree, etc
fetch Download objects and refs from another repository
grep Print lines matching a pattern
init Create an empty Git repository or reinitialize an existing one
log Show commit logs
merge Join two or more development histories together
mv Move or rename a file, a directory, or a symlink
pull Fetch from and integrate with another repository or a local branch
push Update remote refs along with associated objects
rebase Forward-port local commits to the updated upstream head
reset Reset current HEAD to the specified state
rm Remove files from the working tree and from the index
show Show various types of objects
status Show the working tree status
tag Create, list, delete or verify a tag object signed with GPG
'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.
appledeMacBook-Pro:~ apple$ mkdir github//make direction
appledeMacBook-Pro:~ apple$ cd github//change direction
appledeMacBook-Pro:github apple$ 【ls//显示
appledeMacBook-Pro:github apple$ 【mkdir cheery
appledeMacBook-Pro:github apple$ 【cd cheery
appledeMacBook-Pro:cheery apple$ 【git init//初始化
Initialized empty Git repository in /Users/apple/github/cheery/.git/
appledeMacBook-Pro:cheery apple$ 【git status//当前状态
On branch master
Initial commit
Untracked files:
(use "git add <file>..." to include in what will be committed)
Function.java
nothing added to commit but untracked files present (use "git add" to track)
appledeMacBook-Pro:cheery apple$ 【git add Function.java】
appledeMacBook-Pro:cheery apple$ 【git status】
On branch master
Initial commit
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: Function.java
appledeMacBook-Pro:cheery apple$【 git commit -m "init project"//添加一条评论
[master (root-commit) 7ea5e35] init project
1 file changed, 30 insertions(+)
create mode 100644 Function.java
appledeMacBook-Pro:cheery apple$