当前位置:网站首页>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 边栏推荐
- Digital signatures and Ca certificates
- Recommend an artifact to get rid of the entanglement of variable names and a method to modify file names in batches
- Introduction of functions in C language (blood Book 20000 words!!!)
- 【leetcode周赛总结】LeetCode第 83场双周赛(7.23)
- Starfish Os打造的元宇宙生态,跟MetaBell的合作只是开始
- golang 协程的实现原理
- Kubernetes technology and Architecture (VII)
- 【SwinTransformer源码阅读二】Window Attention和Shifted Window Attention部分
- IDC脚本文件运行
- Machine learning (11) -- time series analysis
猜你喜欢

Introduction to official account

Hyperlink label

What are the main uses of digital factory management system

快速上手Flask(一) 认识框架Flask、项目结构、开发环境

No one wants to tell the truth about kubernetes secret

DAPP safety summary and typical safety incident analysis

Huid learning 7: Hudi and Flink integration

Data analysis interview question summary

公众号简介
![[activity registration] User Group Xi'an - empowering enterprise growth with modern data architecture](/img/92/88be42faf0451cb19067672dab69c8.jpg)
[activity registration] User Group Xi'an - empowering enterprise growth with modern data architecture
随机推荐
[activity registration] User Group Xi'an - empowering enterprise growth with modern data architecture
Go panic and recover
Quickly build a gateway service, dynamic routing and authentication process, and watch the second meeting (including the flow chart)
A new method of exposing services in kubernetes clusters
训练一个自己的分类 | 【包教包会,数据都准备好了】
Starfish Os打造的元宇宙生态,跟MetaBell的合作只是开始
[cloud computing] several mistakes that enterprises need to avoid after going to the cloud
完善的交叉编译环境记录 peta 生成的shell 脚本
Code management platform SVN deployment practice
Warehouse of multiple backbone versions of yolov5
golang 协程的实现原理
站在大佬的肩膀上,你可以看的更远
Vs2015 use dumpbin to view the exported function symbols of the library
Centralized log management with sentry
【592. 分数加减运算】
From development to testing: I started from scratch and worked for six years of automated testing
Hundreds of billions of it operation and maintenance market has come to the era of speaking by "effect"
Larkapi access credentials overview
leetcode 452. Minimum Number of Arrows to Burst Balloons 用最少数量的箭引爆气球(中等)
Why is the text box of Google material design not used?