forked from hashicorp/vault-secrets-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |