git回退到之前版本和合并分支查看当前分支切换分支
推到此分支:
git add . git commit -m"xxx" git push切換分支:git checkout xxx(分支名)
添加新分支但是留在當前分支
添加并切換到新分支:
git checkout -b <new name>忽視哪些文件不push上去:
創建.gitignore文件
拉取分支:
git pull
拉取主分支:
查看歷史提交記錄
git log結果:
PS C:\Users\heziyi6\Desktop\automind-backend> git log commit
1a7bcbc5397488d488829e7ff190233d724efb29 (HEAD -> feature-2,
origin/feature-2) Author: heziyi 1417243391@qq.com Date: Sat Mar
12 11:28:32 2022 +0800
commit 7ac690cafb5dfb6885b6030014cedb28aa1da3f1 Merge: 985a547 4dc81e2
Author: heziyi 1417243391@qq.com Date: Sat Mar 12 11:16:35 2022
+0800
回退到某個分支:
git reset --hard 1a7bcbc5397488d488829e7ff190233d724efb29列出本地已經存在的分支:
git branch列出遠程分支
git branch -r列出本地分支和遠程分支
git branch -a例子:
PS C:\Users\heziyi6\Desktop\automind-backend> git branch -a
- feature-1 master remotes/origin/HEAD -> origin/master remotes/origin/develop remotes/origin/feature-1
remotes/origin/feature-2 remotes/origin/feature-export_word
remotes/origin/master …skipping… - feature-1 master remotes/origin/HEAD -> origin/master remotes/origin/develop remotes/origin/feature-1
remotes/origin/feature-2 remotes/origin/feature-export_word
remotes/origin/master
查看現有遠程倉庫的地址url
git remote -v總結
以上是生活随笔為你收集整理的git回退到之前版本和合并分支查看当前分支切换分支的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: class字节码文件中的常量池结构详解
- 下一篇: java解压文件、复制文件、删除文件代码