Git 笔记

Git 笔记

time will tell Lv4

git 笔记

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
git branch --merged                                       # 显示所有已合并到当前分支的分支

git branch --no-merged # 显示所有未合并到当前分支的分支

git branch -m master master_copy # 本地分支改名

git checkout -b master_copy # 从当前分支创建新分支master_copy并检出

git checkout -b master master_copy # 上面的完整版

git checkout features/performance # 检出已存在的features/performance分支

git checkout --track hotfixes/BJVEP933 # 检出远程分支hotfixes/BJVEP933并创建本地跟踪分支

git checkout v2.0 # 检出版本v2.0

git checkout -b devel origin/develop # 从远程分支develop创建新本地分支devel并检出

git checkout -- README # 检出head版本的README文件(可用于修改错误回退)

git merge origin/master # 合并远程master分支至当前分支

git cherry-pick ff44785404a8e # 合并提交ff44785404a8e的修改

git push origin master # 将当前分支push到远程master分支

git push origin :hotfixes/BJVEP933 # 删除远程仓库的hotfixes/BJVEP933分支
  • Title: Git 笔记
  • Author: time will tell
  • Created at : 2024-09-24 20:54:52
  • Updated at : 2024-07-30 17:45:48
  • Link: https://sbwrn.github.io/2024/09/24/git笔记/
  • License: This work is licensed under CC BY-NC-SA 4.0.
Comments
On this page
Git 笔记