当前位置:网站首页>1.5 merge\rebase\revert\stash\branch
1.5 merge\rebase\revert\stash\branch
2022-07-28 09:12:00 【LetsStudy】
1、git merge <branch> Merging branches
git checkout master // The current branch is master
git branch test // With master As the base , newly build test Branch
git checkout test // Check out the test Branch , Modify the content
git checkout master // Check out the master Branch
git merge test// hold test Branch into master Branch 2、git pull / git fetch
git pull origin master:test // Pull remote master Branch , Merge into local test Branch
Equate to
git fetch origin master
git merge FETCH_HEAD3、git rebase
git rebase master // Variable base , Up-to-date master Branch based , Pull the code and merge it into the local branch
Equate to
git pull -r origin master
or
git pull -rebase origin master
4、git revert
// General withdrawal , A new submission record will be generated
git revert <commitId>
/*
* merge commit withdraw
* merge commit There will be two. parent commitId
* Represents which two commitId The merger of
* therefore -m The value of is 1 or 2, It means which submission to keep
**/
git revert <commitId> -m 1
//revert Then proceed in the current branch merge, Was previously revert The file will not be merge Come in
//master Branch merging release Branch , after revert,release After the branch is modified ,master Cannot merge in release Branching problem
git branch test // stay master Pull a new one test Branch
git checkout test // Check out the test Branch
git show // see commit Record
git revert <commitId> // stay test To execute on a branch revert operation
git merge release // stay test On branch merge release
git checkout master // Check out the master
git merge test // stay master On branch merge test
git branch -d test // Delete test Branch 5、git branch
git branch test // New branch
git branch // View local branch
git branch -r // View remote branches
git push origin -d <branchName> // Delete remote branch
git branch -d <branchName> // Delete local branch 6、git stash
Archive staging area and workspace
git stash save test1 // Newly added code and commit Of , Will be temporarily saved
git stash list // View the saved history list
git stash pop 0 // Restore temporarily saved content , If the recovery record is not specified , The latest saved record will be restored by default
git stash apply 0 // You can use , Restore the saved records to other branches
git stash drop 0 // Clear the specified record
git stash clear // Clear all stored records
git stash show // Check the difference between the stored record and the current file
git stash show 0 // View the difference between the specified storage record and the current file
git stash show 0 -p // See the detailed differences
git stash branch <branchName> 0 // According to a storage record , Pull a new branch , For manual conflict resolution 边栏推荐
- JSON 文件存储
- 【英语考研词汇训练营】Day 15 —— analyst,general,avoid,surveillance,compared
- Kubernetes data persistence scheme
- Prometheus TSDB analysis
- Oracle SQL problems
- LeetCode_406_根据身高重建队列
- Network interface network crystal head RJ45, Poe interface definition line sequence
- Introduction of functions in C language (blood Book 20000 words!!!)
- Sword finger offer
- Map of China province > City > level > District > Town > village 5-level linkage download [2019 and 2021]
猜你喜欢

JSON 文件存储

Explain cache consistency and memory barrier

【英语考研词汇训练营】Day 15 —— analyst,general,avoid,surveillance,compared

Digital signatures and Ca certificates

Go interface Foundation

Sentinel

MDM data quality application description

There is a bug in installing CONDA environment

Linux initializes MySQL with fatal error: could not find my-default.cnf
![Map of China province > City > level > District > Town > village 5-level linkage download [2019 and 2021]](/img/ea/fd799bbef5110fddf4066e76892f81.png)
Map of China province > City > level > District > Town > village 5-level linkage download [2019 and 2021]
随机推荐
Chapter 2-14 sum integer segments
Starfish Os打造的元宇宙生态,跟MetaBell的合作只是开始
Data analysis interview question summary
公众号简介
站在大佬的肩膀上,你可以看的更远
Hou Jie STL standard library and generic programming
ES6 let and Const
Argocd Web UI loading is slow? A trick to teach you to solve
1.5 merge\rebase\revert\stash\branch
Kubernetes cluster configuration serviceaccount
看得清比走得快更重要,因为走得对才能走得远
Setting of parameter configuration tool for wireless vibrating wire collector
蓝牙技术|2025年北京充电桩总规模达70万个,聊聊蓝牙与充电桩的不解之缘
训练一个自己的分类 | 【包教包会,数据都准备好了】
Mobaxtermsession synchronization
中国地图省>市>级>区>镇>村5级联动下载【2019和2021】
From development to testing: I started from scratch and worked for six years of automated testing
JSON 文件存储
XMIND Zen installation tutorial
mysql主从架构 ,主库挂掉重启后,从库怎么自动连接主库