@Sarah
2015-05-24T08:40:04.000000Z
字数 2538
阅读 1409
未分类
在此输入正文
//打开终端Last login: Sun May 24 09:02:37 on consoleappledeMacBook-Pro:~ apple$ gitxcode-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$ gitusage: 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 indexbisect Find by binary search the change that introduced a bugbranch List, create, or delete branchescheckout Checkout a branch or paths to the working treeclone Clone a repository into a new directorycommit Record changes to the repositorydiff Show changes between commits, commit and working tree, etcfetch Download objects and refs from another repositorygrep Print lines matching a patterninit Create an empty Git repository or reinitialize an existing onelog Show commit logsmerge Join two or more development histories togethermv Move or rename a file, a directory, or a symlinkpull Fetch from and integrate with another repository or a local branchpush Update remote refs along with associated objectsrebase Forward-port local commits to the updated upstream headreset Reset current HEAD to the specified staterm Remove files from the working tree and from the indexshow Show various types of objectsstatus Show the working tree statustag Create, list, delete or verify a tag object signed with GPG'git help -a' and 'git help -g' list available subcommands and someconcept guides. See 'git help <command>' or 'git help <concept>'to read about a specific subcommand or concept.appledeMacBook-Pro:~ apple$ mkdir github//make directionappledeMacBook-Pro:~ apple$ cd github//change directionappledeMacBook-Pro:github apple$ 【ls//显示appledeMacBook-Pro:github apple$ 【mkdir cheeryappledeMacBook-Pro:github apple$ 【cd cheeryappledeMacBook-Pro:cheery apple$ 【git init//初始化Initialized empty Git repository in /Users/apple/github/cheery/.git/appledeMacBook-Pro:cheery apple$ 【git status//当前状态On branch masterInitial commitUntracked files:(use "git add <file>..." to include in what will be committed)Function.javanothing 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 masterInitial commitChanges to be committed:(use "git rm --cached <file>..." to unstage)new file: Function.javaappledeMacBook-Pro:cheery apple$【 git commit -m "init project"//添加一条评论[master (root-commit) 7ea5e35] init project1 file changed, 30 insertions(+)create mode 100644 Function.javaappledeMacBook-Pro:cheery apple$