rebase

How-to git backport (rebase/cherry-pick) an already merged branch

吃可爱长大的小学妹 提交于 2019-12-18 03:45:53
问题 In our Git process, "master" is the integration branch for topic and fix branches for the current release cycle, but we also maintain a "stable" branch where we have to backport carefully some of our fixes already successfully tested on master. All the difficulty is that the branch has already been merged back in "master" (else it is really easy with rebase --onto) We don't want to change the process the other way because a) we don't want to fix everything in the "stable" branch, and b) we

How-to git backport (rebase/cherry-pick) an already merged branch

梦想的初衷 提交于 2019-12-18 03:45:09
问题 In our Git process, "master" is the integration branch for topic and fix branches for the current release cycle, but we also maintain a "stable" branch where we have to backport carefully some of our fixes already successfully tested on master. All the difficulty is that the branch has already been merged back in "master" (else it is really easy with rebase --onto) We don't want to change the process the other way because a) we don't want to fix everything in the "stable" branch, and b) we

git rebase interactive: squash merge commits together

瘦欲@ 提交于 2019-12-17 17:25:12
问题 I wanted to have a simple solution to squash two merge commits together during an interactive rebase. My repository looks like: X --- Y --------- M1 -------- M2 (my-feature) / / / / / / a --- b --- c --- d --- e --- f (stable) That is, I have a my-feature branch that has been merged twice recently, with no real commits in between. I don't just want to rebase the my-feature branch since it is a published branch of its own, I just want to squash together the last two merge commits into one

Git: How to rebase to a specific commit?

心不动则不痛 提交于 2019-12-17 17:24:21
问题 I'd like to rebase to a specific commit, not to a HEAD of the other branch: A --- B --- C master \ \-- D topic to A --- B --- C master \ \-- D topic instead of A --- B --- C master \ \-- D topic How can I achieve that? 回答1: You can avoid using the --onto parameter by making a temp branch on the commit you like and then use rebase in it's simple form: git branch temp master^ git checkout topic git rebase temp git branch -d temp 回答2: You can even take a direct approach: git checkout topic git

Git: How to rebase to a specific commit?

不打扰是莪最后的温柔 提交于 2019-12-17 17:22:17
问题 I'd like to rebase to a specific commit, not to a HEAD of the other branch: A --- B --- C master \ \-- D topic to A --- B --- C master \ \-- D topic instead of A --- B --- C master \ \-- D topic How can I achieve that? 回答1: You can avoid using the --onto parameter by making a temp branch on the commit you like and then use rebase in it's simple form: git branch temp master^ git checkout topic git rebase temp git branch -d temp 回答2: You can even take a direct approach: git checkout topic git

Unable to understand Git branch, merge and rebase

拈花ヽ惹草 提交于 2019-12-17 15:58:22
问题 I know the thread which says that rebase is for small changes of teamMates, while merge for large changes. I keep three Gits of three teammates in the following directory structure where we all have the same initial code: project | - I | - myTeamMate1 | - myTeamMate2 The branches are not in the same Git. This means that I cannot use rebase and merge. I have used vimdiff to sync changes between teamMates. However, this is time-consuming. I have unsuccessfully tried to make the following

How to skip “Loose Object” popup when running 'git gui'

假如想象 提交于 2019-12-17 10:13:21
问题 When I run 'git gui' I get a popup that says This repository currently has approximately 1500 loose objects. It then suggests compressing the database. I've done this before, and it reduces the loose objects to about 250, but that doesn't suppress the popup. Compressing again doesn't change the number of loose objects. Our current workflow requires significant use of 'rebase' as we are transitioning from Perforce, and Perforce is still the canonical SCM. Once Git is the canonical SCM, we will

Remove folder and its contents from git/GitHub's history

☆樱花仙子☆ 提交于 2019-12-17 01:25:29
问题 I was working on a repository on my GitHub account and this is a problem I stumbled upon. Node.js project with a folder with a few npm packages installed The packages were in node_modules folder Added that folder to git repository and pushed the code to github (wasn't thinking about the npm part at that time) Realized that you don't really need that folder to be a part of the code Deleted that folder, pushed it At that instance, the size of the total git repo was around 6MB where the actual

What's the difference between 'git merge' and 'git rebase'?

余生颓废 提交于 2019-12-16 22:19:15
问题 What's the difference between git merge and git rebase ? 回答1: Suppose originally there were 3 commits, A , B , C : Then developer Dan created commit D , and developer Ed created commit E : Obviously, this conflict should be resolved somehow. For this, there are 2 ways: MERGE : Both commits D and E are still here, but we create merge commit M that inherits changes from both D and E . However, this creates diamond shape, which many people find very confusing. REBASE : We create commit R , which

Why does git pull origin develop --rebase cause conflict when git pull origin develop doesn't?

余生长醉 提交于 2019-12-13 18:18:51
问题 Now normally I use git pull origin develop into get the latest updates from the develop branch. Recently, my team has been transitioning into using rebase instead of merging so I'm a bit confused on some stuff. Before my workflow is pretty straight forward. I would first checkout into the develop branch and use git checkout -b feature/foo I would then make my changes, commit and then push them. Usually the develop branch would have some changes made thus, I would use git pull origin develop