git操作简要笔记

1. 下载代码

如果是新的项目,可以使用
git clone XXX.git

如果已经有.git文件,可以在项目下直接使用
git pull

2. 更新代码

加入缓存区
git stage .

提交到本地库
git commit
也可以直接git commit -a,跳过缓存区

本地库提交到线上
git push

3. 回退

回退到stage版本
git checkout – XX

查看区别
git diff:和stage差别

重置
git reset XX,取消stage
git checkout XX,取消commit,回到stage

猜你喜欢

转载自blog.csdn.net/kittyzc/article/details/106646682
今日推荐