Skip to content

Commit

Permalink
Merge branch 'master' of github.com:pranavgade20/practice-git
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavgade20 committed Mar 11, 2022
2 parents 4902285 + 687fac0 commit 2386c19
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions SQUASH_AND_MERGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ Usually, when multiple people work on the same file, managing everyone's contrib
## Setup

- Create a branch called `squashing`
- In your `squashing` branch, add a program to print `Hello, World` and save it in a file called `hello`(for example, `hello.py`)
- Switch back to `master`, and create a new branch called `hello-git`. In `hello-git`, add a program to print `Hello, git` and save it in a file called `hello`(this name has to be the same as the name above)
- In your `squashing` branch, add a program to print `Hello, World` and save it in a file called `hello`(for example, `hello.py`). Add it to git and commit it.
- Switch back to `master`, and create a new branch called `hello-git`. In `hello-git`, add a program to print `Hello, git` and save it in a file called `hello`(for example, `hello.py`. This name has to be the same as the name above). Add it to git and commit it.

Notice that we have modified/created the same file with the same path in the repository. What do you think will happen when we try to merge these branches?

## Merging

In your `squashing` branch, `git merge hello-git` to merge the `hello-git` branch into `squashing`. You will probably see a scary message like this:
In your `squashing` branch, `git merge --squash hello-git` to merge the `hello-git` branch into `squashing`. You will probably see a scary message like this:

```
Auto-merging hello.py
Expand Down

0 comments on commit 2386c19

Please sign in to comment.