git命令

在这里插入图片描述
拉取代码:

git pull

推本地代码上去:

1、git status 
2、git add [filename1] [filename2] 
3、git commit [filename1] -m “提交信息说明” 
4、git push

提交代码:

git add . (提交)
git commit -m "设为首页,收藏的实现" (备注提交内容)
git fetch (拉取代码)
git rebase origin/master  (更新代码同步)
git push origin master  (最后提交代码)

回退:

1、退回至缓存区的coding回退 
git reset [filename1] 
2、会退到制定版本 
git reset –hard 版本号(版本号为commit后的)

看提交日志:

git log 
git log –oneline

分支:

1、查看分支 
git branch 
2、创建分支 
git branch 分支名 
3、切花分支 
git checkout 分支名 
git checkout -b 分支名(创建并切换分支) 
4、合并某分支到当前分支 
git merge 分支名 
5、删除分支 
git branch -d 分支名(强行删除 -D) 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章