git 命令

###给远程添加 仓库路径
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}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值