# \[Tips and Tricks\] Managing Merge Requests locally

**URL:** <https://forums.librehealth.io/t/tips-and-tricks-managing-merge-requests-locally/2950>\
**Category:** Development\
**Tags:** git, gitlab, github, tips-and-tricks\
**Created:** [March 3, 2019, 2:31am UTC](https://forums.librehealth.io/t/tips-and-tricks-managing-merge-requests-locally/2950 "2019-03-03T02:31:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![r0bby](https://forums.librehealth.io/user_avatar/forums.librehealth.io/r0bby/32/1781_2.png) [@r0bby](https://forums.librehealth.io/u/r0bby)\
**Post date:** [March 3, 2019, 2:31am UTC](https://forums.librehealth.io/t/tips-and-tricks-managing-merge-requests-locally/2950/1 "2019-03-03T02:31:06Z")

</div>

I like working locally when merging merge requests and pull requests.

LibreHealth straddles between GitHub and GitLab.

I use two zsh functions, which will also work on bash:

GitHub:

```bash
gpr() { git fetch $1 refs/pull/$2/head:$3 }

```

GitLab:

```bash
gmr() { git fetch $1 refs/merge-requests/$2/head:$3}

```

Using them like such:

For GitLab:

```bash
gmr origin 1 someTitleForTheLocalBranch

```

Similar for GitHub:

```bash
gpr origin 1 someTitleForTheLocalBranch

```

A note: `origin` assumes the remote is named `origin` – usually, the remotes are named `upstream`, with my fork being `origin`.

Hope this helps others.
