Git - Difference between amend and squash commands -


am wondering difference between amend , squash commands, tried both , found both doing same proper management.

in git, commits actual destroyed, become orphans, or detached, meaning not pointed or reachable reference branch or tag.

"amending" , "squashing" are similar concepts though.

typically, amending single commit operation in want combine work have staged head commit. can convenient if have created commit , realize need add content it. recall commit command , use --amend option.

squashing more abstract term. amend type of squash. whenever combine commits squashing them. if have been working on branch little while , have made 5 commits taken should 1 commit, can interactively rebase squash them together.

there several ways in git amend/squash, center around concept of organizing commit history (which means re-writing history of branch) in spirit of making easier grok.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -