2022-06-25 11:40:44 +02:00
|
|
|
---
|
|
|
|
title: Git
|
2022-11-19 15:25:20 +01:00
|
|
|
visible: true
|
2022-06-25 11:40:44 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
[toc]
|
2023-02-23 14:48:51 +01:00
|
|
|
|
2022-06-25 11:40:44 +02:00
|
|
|
## Reset everything to selected branch
|
|
|
|
|
2023-02-23 14:48:51 +01:00
|
|
|
Useful for getting to the same state as upstream
|
|
|
|
|
|
|
|
```sh
|
|
|
|
git reset --hard (upstream)/(branch)
|
|
|
|
git pull (upstream) (branch)
|
|
|
|
```
|
|
|
|
|
|
|
|
Finally force push all of this into your own repo
|
2022-06-25 11:40:44 +02:00
|
|
|
|
|
|
|
## Get Pull Request from foreign repo
|
2023-02-23 14:48:51 +01:00
|
|
|
|
|
|
|
_Example with neofetch_
|
2022-06-25 11:40:44 +02:00
|
|
|
|
|
|
|
Add remote if you haven't already done that
|
2023-02-23 14:48:51 +01:00
|
|
|
`git remote add dylanaraps https://github.com/dylanaraps/neofetch.git`
|
2022-06-25 11:40:44 +02:00
|
|
|
|
2023-02-23 14:48:51 +01:00
|
|
|
Remotes can be show with `git remote show`
|
2022-06-25 11:40:44 +02:00
|
|
|
|
|
|
|
Fetch desired commits
|
2023-02-23 14:48:51 +01:00
|
|
|
`git fetch dylanaraps a0221c51ff4c8ce834d7e3431f2770b6879de009`
|
2022-06-25 11:40:44 +02:00
|
|
|
|
|
|
|
Cherry pick commits
|
2023-02-23 14:48:51 +01:00
|
|
|
`git cherry-pick -m 1 a0221c51ff4c8ce834d7e3431f2770b6879de009`
|
2022-06-25 11:40:44 +02:00
|
|
|
|
2023-02-23 14:48:51 +01:00
|
|
|
Resolve whatever conflicts arise
|