【git】相关操作

创建分支

新建gitlab分支_gitlab创建分支-CSDN博客

 

查看远程所有分支

$ git branch -a

新建分支并切换到指定分支

git checkout -b 本地分支名 origin/远程分支名

 拉取远端分支

git pull origin model_201

显示哪些文件已经被修改

git status

 切换到已有分支

git checkout feature-branch

解决冲突

保存更改

git stash  
git checkout feature-branch

切换分支后,可以使用 git stash pop 恢复之前保存的更改。

提交更改

git add .  
git commit -m "Your commit message"  
git checkout feature-branch

放弃更改

git reset --hard  
git checkout feature-branch

 


posted on 2024-09-27 13:46  张凌赫_帅  阅读(17)  评论(0)    收藏  举报

导航