mirror of
https://gitlab.com/2009scape/contributor-wiki.git
synced 2026-08-01 14:19:13 -06:00
Merge branch 'git-help' into 'main'
Add guide for fixing broken master/main See merge request 2009scape/contributor-wiki!2
This commit is contained in:
commit
7df998bf0b
1 changed files with 15 additions and 0 deletions
|
|
@ -125,3 +125,18 @@ git push --force origin cider
|
|||
|
||||
4) If you've lost something you did not backup you can use ```git checkout {hash}``` to try and find the pieces.
|
||||
|
||||
## Undoing updating a local master
|
||||
It's possible at some point you accidently update your master branch. This will cause you problems. Before you do this you will need to temporarly allow [force pushing](https://docs.gitlab.com/ee/user/project/protected_branches.html#allow-force-push-on-a-protected-branch) to your master branch. Make sure to turn it off afterwards.
|
||||
|
||||
1) Get the latest upstream files
|
||||
```
|
||||
git fetch -ap upstream
|
||||
```
|
||||
2) Reset your master branch. **Warning you will lose any locally changed files that are only on master!**
|
||||
```
|
||||
git reset --hard upstream/master
|
||||
```
|
||||
3) Push to your master branch
|
||||
```
|
||||
git push origin master --force
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue