Questions tagged [git-squash]

git squash is the command used to rewrite git history before it is pushed to the remote.

GIT doesn't provide a modify history tool but provides measures to do so if the need arises. One can use git rebase in the interactive mode (git rebase -i) to achieve this with the parent of the last commit that you want to edit as the argument.

This is where git would present a text editor with the commits between this commit and the head listed in the reverse order. You can use "pick", "edit" or "squash" a commit.

squash specifically tells git to apply the commits in question and the commit before them in order and makes you to merge the commit messages.

This is a good way to keep the commit history on the remote cleaner while taking advantages of the version control to checkpoint your local code repo.

git rebase rewrites the history of the commits between parent mentioned above and head. Use with caution! It is not recommended to use this with the code that is already pushed to the remote.

216 questions
-1
votes
1 answer

Azure Devops Git Squash-Commit Issue fake commits

my company is currently working on Azure Cloud, managing our code repositories using Azure Devops and Git. For some months we decided to use the Squash-commit when we wanted to merge our feature branches into our develop branch through the means of…
-1
votes
2 answers

Git how to squash all the commit

I have try to use git rebase -i HEAD~3 to squash all the commit. But git throw below error, for the commit HEAD~3 is not exist. fatal: invalid upstream 'HEAD~3' $ git log --oneline 7cabc02 (HEAD -> master) fix bug 26a9c03 fix bug 59fe21b record…
LF00
  • 27,015
  • 29
  • 156
  • 295
-1
votes
2 answers

Automatically Rebase and Squash Git History From a Commit ID to HEAD from Branch to Master

Is it possible to use git rebase to remove all of the history from a specific commit to the HEAD revision? With git -i rebase, you have to count all of the commits in the git log and manually get squash of all of them except one commit before…
jfleach
  • 501
  • 1
  • 8
  • 21
-1
votes
1 answer

Branch squash-merged to master, and merged back to branch

My git workflow consists in feature branches squash-merged to master after they have been validated. However, I am unaware of the consequences of these squashed commits being brought back to the same branch they came from, via merge master without…
lightlazer
  • 133
  • 1
  • 5
-1
votes
1 answer

Git merge and ovewrite from tag

I'm trying to keep 2 separated branches on git, the "Dev" on which I work and the "Master" which is basically a clean branch where I push clean versions of my project. The problem here is that I don't want any history from previous commit when I…
Robray
  • 1
-2
votes
1 answer

How to Deal with Many Progress Commits

I like to commit often and for small, logical parts of code. If I'm working on a large feature (2+ weeks), there will be many commits such as: Paged menu controller working progress in XYZ (SAVING WORK AT END OF DAY so if laptop is lost, work is…
wawynon
  • 9
  • 1
1 2 3
14
15