Skip to content

Commit

Permalink
*: Add repo update steps
Browse files Browse the repository at this point in the history
To avoid future problems with the repo, we need to add the steps to update the repo with the new changes from the upstream repo.
  • Loading branch information
inigohu committed Jan 10, 2024
1 parent 7ba3571 commit e2d3ee0
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions UPDATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
To update your forked repository with the latest changes from the original repository (upstream), you can follow these steps using the command line. Make sure you have Git installed on your machine. Here's a step-by-step guide:

### Step 1: Create a Backup Branch

```bash
# Assuming you are currently on your main branch
git branch backup_branch

# This will create a new branch named 'backup_branch' pointing to the same commit as your current branch
```

### Step 2: Rebase and Force Push

Perform the rebase and force push as discussed earlier:

```bash
# Fetch the latest changes from upstream
git fetch upstream

# Rebase your changes on top of upstream
git rebase upstream/main

# Resolve conflicts (if any) and continue the rebase

# Force push to your forked repository
git push origin main --force
```

### Step 3: In Case of Issues, Restore from Backup

If something goes wrong or you need to revert the changes, you can easily switch back to the backup branch:

```bash
# Switch to the backup branch
git checkout backup_branch

# Force push the backup branch to restore it
git push origin backup_branch --force
```

This way, you always have a backup branch pointing to the state before the rebase and force push. If anything unexpected happens, you can quickly switch back to the backup branch.

Please note that force-pushing and rewriting history can have implications, especially in a collaborative environment. It's crucial to communicate such actions with your team and follow any established best practices or guidelines.

0 comments on commit e2d3ee0

Please sign in to comment.