Skip to content

Commit

Permalink
Update about-comparing-branches-in-pull-requests.md
Browse files Browse the repository at this point in the history
  • Loading branch information
VimaleshCT authored Oct 14, 2024
1 parent 99edc31 commit fe6858f
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ To see two committish references in a two-dot diff comparison on {% data variabl

A two-dot diff compares two Git committish references, such as SHAs or OIDs (Object IDs), directly with each other. On {% data variables.product.prodname_dotcom %}, the Git committish references in a two-dot diff comparison must be pushed to the same repository or its forks.

If you want to simulate a two-dot diff in a pull request and see a comparison between the most recent versions of each branch, you can merge the base branch into your topic branch, which updates the last common ancestor between your branches.

Check failure on line 73 in content/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-comparing-branches-in-pull-requests.md

View workflow job for this annotation

GitHub Actions / lint-content

Multiple consecutive blank lines

Expected: 1; Actual: 2.
To simulate a two-dot diff in a pull request and compare the latest versions of each branch, you can merge the base branch into your topic branch. This updates the last common ancestor between the two branches.

For more information about Git commands to compare changes, see "[Git diff options](https://git-scm.com/docs/git-diff#git-diff-emgitdiffemltoptionsgtltcommitgtltcommitgt--ltpathgt82308203)" from the _Pro Git_ book site.

Expand All @@ -84,7 +85,7 @@ In contrast, by comparing the branches using the three-dot comparison, changes i

### Merging often

To avoid getting confused, merge the base branch (for example, `main`) into your topic branch frequently. By merging the base branch, the diffs shown by two-dot and three-dot comparisons are the same. We recommend merging a pull request as soon as possible. This encourages contributors to make pull requests smaller, which is recommended in general.
To avoid confusion, regularly merge the base branch (e.g., main) into your topic branch. Doing so ensures that the diffs in both two-dot and three-dot comparisons remain consistent. It's best to merge pull requests as soon as possible, as this encourages smaller, more manageable pull requests, which is generally recommended.

## Further reading

Expand Down

0 comments on commit fe6858f

Please sign in to comment.