squash

How can I rebase in git without resolving other commit conflicts, or squash all of my commits while leaving others' commits untouched?

跟風遠走 提交于 2021-02-20 03:51:44
问题 ---A--- / \ ---main-------- \---B---+A------/ \-----\--\C-? Above is roughly the situation on my team's repo. Feature A is a giant branch that I absolutely have to leave alone. I branched off of B but have been pulling from it periodically, which means that I have all of A's changes and am up to date with main on branch C. This also means that between my first and last commit on C, there are dozens of commits plus a giant merge from A. My repo requires that each push to main be squashed, and

How can I squash a range of git commits together given starting and ending SHA's

跟風遠走 提交于 2020-07-05 00:09:00
问题 I have a branch with about 20 commits. The first SHA on the branch is bc3c488... The last SHA on the branch is 2c2be6... How can I merge all the commits together? I want to do this without using interactive rebase as there are so many commits. I need this for a github Pull Request where I am being asked to merge my commits. Need to do this without doing a git merge --squash as I need to squash locally and another developer does the merge and wants me to do the squash first before merging. 回答1

How can I squash a range of git commits together given starting and ending SHA's

空扰寡人 提交于 2020-07-05 00:05:22
问题 I have a branch with about 20 commits. The first SHA on the branch is bc3c488... The last SHA on the branch is 2c2be6... How can I merge all the commits together? I want to do this without using interactive rebase as there are so many commits. I need this for a github Pull Request where I am being asked to merge my commits. Need to do this without doing a git merge --squash as I need to squash locally and another developer does the merge and wants me to do the squash first before merging. 回答1

Merging a branch of a branch after first branch is squashed when merged to master

人走茶凉 提交于 2020-01-30 13:42:31
问题 Here's a workflow that I commonly deal with at work. git checkout -b feature_branch # Do some development git add . git commit git push origin feature_branch At this point the feature branch is up for review from my colleagues, but I want to keep developing on other features that are dependent on feature_branch . So while feature_branch is in review... git checkout feature_branch git checkout -b dependent_branch # Do some more development git add . git commit Now I make some changes in

Git: How to convert an existing `merge` to a `merge --squash`?

為{幸葍}努か 提交于 2020-01-13 19:07:45
问题 I performed multiple merge commits but they should have been merge --squash instead. The conflict resolution took more than a day so I can't afford to redo the merging by hand. Is there a way to convert the merge to merge --squash ? 回答1: It's worth noting here that git merge and git merge --squash are closely related, but git merge --squash does not create a merge . The phrasing here is very important, particularly the article "a" in front of "merge": "a merge" is a noun, while "to merge" is

Git: How to convert an existing `merge` to a `merge --squash`?

强颜欢笑 提交于 2020-01-13 19:05:11
问题 I performed multiple merge commits but they should have been merge --squash instead. The conflict resolution took more than a day so I can't afford to redo the merging by hand. Is there a way to convert the merge to merge --squash ? 回答1: It's worth noting here that git merge and git merge --squash are closely related, but git merge --squash does not create a merge . The phrasing here is very important, particularly the article "a" in front of "merge": "a merge" is a noun, while "to merge" is

error: could not apply ---> tried it in proper way by seeing instructions but still errors for git squash

白昼怎懂夜的黑 提交于 2019-12-31 05:38:09
问题 I am new to git and I tried to squash my commits. In my branch, it shows my 32 commits (John Smith), within that three commits of another two developers too (Prince Rolf and Harry). For one commit a developer has amended. Now if I try to squash all the commits I am getting an error: error: could not apply ccdfa76... Add readme.md I googled for the error, but was not able to find it. I tried squashing by ten and then ten but that also throwing error. Can you guys tell me how to swim it

Squashing all of my commits (including merges) into one commit without altering history

蹲街弑〆低调 提交于 2019-12-24 15:01:33
问题 Say I have 100 commits in my branch that I've been working on for 3 weeks. Occasionally (every day, really) I pull from origin/master and merge it into my branch. How could I (easily) go about squashing all of my commits into one commit without messing up history? If I squash all of my commits into one somehow, would I destroy the merged origin/master pulls when my pull request gets moved into origin/master? 回答1: "Squashing" and "preserving history" are approximately direct opposites in

git interactive rebase squash into next commit

跟風遠走 提交于 2019-12-23 12:24:04
问题 In Git I can use an interactive rebase to re-write history, this is great because in my feature branch I made a ton of commits with partially working code as I explored different refactors and ways of getting it done. I'd like to squash a lot of the commits together before rebasing or merging the branch onto master. Some made up commits in order from first (top) to bottom (last) 1. Initial commit on feature branch "Automatic coffee maker UI" 2. Add hot chocolate as product 3. Add tea as

Checking if a Git branch has been merged into master when SQUASHED?

对着背影说爱祢 提交于 2019-12-23 08:00:10
问题 I'd like to automate cleaning of remote branches. I want to be able to check to see if a branch has been merged into master already. Originally, my plan was to use git merge-base to see the last common commit. However, it turns out that we squash all of our branches as we merge them into master. As this creates a new commit hash, I'm unable to find the common commits between master and my branches. How might I go about determining if a branch has been merged if we've squashed them all when