git init # 初始化git仓库
#(执行完git init命令后,会生成一个.git目录,该目录包含了资源数据,且只会在仓库的根目录生成,并且会默认生成一个master分支。)
git init newDir #(在指定的目录下生成仓库)
git clone # 克隆一个git仓库
git clone <url> [directory]
git config #配置全局变量
git config --global user.name '你的用户名'
git config --global user.email '你的邮箱'
git status #查看文件的状态命令
git add #添加文件到缓存命令
git commit #将缓存区内容添加到仓库中,可以在后面加-m选项,以在命令行中提供提交注释
git commit -m "注释"
git commit -am "注释"
git push #推送到远程仓库
git push -u origin master # 提交到master分支
git remote add [shortname] [url] #
git branch
git branch (branchname)
git checkout (branchname)
git merge
git branch -d (branchname)
git remote rm [别名]
git fetch
git merge [branchname]
git pull
git push