###给远程添加 仓库路径
git remote add origin https://github.com//
###给移除远程仓库地址
git remote remove
##查看远程仓库 所有远程地址
git remote -v
##push
git push origin master-local-branch-name:remote-branch-name
git push origin origin-authority 表示提交到remote远程上 和本地一样的origin-authority分支 没有则创建
其中origin是远程地址 一般用这个默认代表
##查看分支情况
git branch
##创建分支
git branch create-name
##切换分支 git checkout 分支名
git checkout dev-name
##查看修改在缓存区的文件情况,和未提交状态
git status
##查看提交情况
git log
##查看 所有的记录包括reset 回去的
git reflog
提交到缓存区
git add 文件名
###提交到暂存区 所有
git add -A
##提交到版本库
git commit
###提交到版本库所有
git commit -a
##已经add到暂存区了,但是想删除这个,回到工作区的状态
git reset HEAD …
##已经add到暂存区了,但是在暂存区又修改了这个,还没有
##add操作,想回到最初add到暂存区的状态
(use “git add …” to update what will be committed)
(use “git checkout – …” to discard changes in working directory)
git checkout – ##有-- 这个 ,不然会认为切换分支
##其实都有提示使用git status 命令
##查看差异 两个不同的文件,在add到暂存区
git diff c-name
##跨分支保存修改,回头再来继续开发
git stash save “message”
git stash list
git stash apply stash@{0}