mirror of
https://gh-proxy.org/https://github.com/klinsmaya/dashjim.github.com.git
synced 2026-11-08 01:16:54 +08:00
add post 03-17
This commit is contained in:
@@ -12,7 +12,8 @@ tags:
|
||||
### `git merge` and `git merge --squash`
|
||||
|
||||
In below example I am going to merge `dev3` into `dev2` and `dev4` by using merge with and without `--squash` parameter.
|
||||
Initial status:
|
||||
|
||||
** Initial status **
|
||||
|
||||

|
||||
|
||||
@@ -24,6 +25,8 @@ git merge --squash dev3
|
||||
git commit -a
|
||||
```
|
||||
|
||||

|
||||
|
||||
We can see changed files in working directory and after commit we don't see `fbcb87a` and `b85fcb7` in the history of `dev4`
|
||||
|
||||
**Plain merge **
|
||||
@@ -33,7 +36,7 @@ git checkout dev2
|
||||
git merge dev3
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
Now `dev4` and `dev2` have the same content, but we cannot see `dev4` comes contains commit form `dev3`, but `dev2` has the information.
|
||||
|
||||
@@ -47,7 +50,7 @@ Now `dev4` and `dev2` have the same content, but we cannot see `dev4` comes cont
|
||||
|
||||
** Before rebase **
|
||||
|
||||

|
||||

|
||||
|
||||
** rebase **
|
||||
|
||||
@@ -60,7 +63,7 @@ git rebase master
|
||||
|
||||
> Notice: dev commit ccd4673 changed to 9d76e0b
|
||||
|
||||

|
||||

|
||||
|
||||
** Conclusion**
|
||||
|
||||
|
||||
Reference in New Issue
Block a user