Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add in some extra clarifications on how to check if a rebase worked #52

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 29 additions & 18 deletions episodes/08-rebase.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,16 @@ $ git log --decorate --oneline --graph
* ed14d18 (origin/main) Adds Robert FitzRoy as an author (#8)
```

It's a good idea here to diff against
your backup branch to check that you
haven't accidentally removed changes.

```bash
$ git diff add_plot_script.backup add_plot_script
```

This command should show **no** output.

::: callout

## detached HEAD
Expand All @@ -410,21 +420,6 @@ output above, on the feature branch.

## Updating a Branch

::::::::::::::::::::::::::::::::::::: instructor

To ensure the `main` branch of the
`git-training-demo` repository has
moved forward one commit, the co-instructor
should merge a PR making any change
they like to the repository.

Or they can make a direct edit and merge
to main by for example editing the `README.md`
file and using their branch protection
override.

::::::::::::::::::::::::::::::::::::::::::::::::

You can also use rebase to move your changes to
branch off the `HEAD` of `main`.
While we rebased our feature branch another
Expand Down Expand Up @@ -458,9 +453,7 @@ gitGraph
commit id: 'd7def6a'
```

Go back to your fork on GitHub
and click on the [**Sync fork**](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork) button.
Then run `git pull` to fetch the changes:
Run `git pull` to fetch the changes from GitHub:

```bash
$ git pull origin main
Expand Down Expand Up @@ -492,6 +485,24 @@ is difficult to impossible.

:::

### Updating a Branch with Upstream Changes

Go back to your fork on GitHub
and click on the [**Sync fork**](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork) button.

Then you can follow the steps above to update
your branch.

It's a good idea to diff your origin feature branch here.

```bash
$ git diff feature origin/feature
```

You should only see the changes brought
in from the upstream repository **not**
your feature branch changes.

## Updating the Remote

If you are rebasing a feature branch you have
Expand Down