<p>This is the pattern to fetch all Merge Requests from GitLab -</p>
<pre><code>git ls-remote origin 'refs/merge-requests/*/head'
</code></pre>
<p>OR</p>
<pre><code>git ls-remote origin 'refs/merge-requests/*/merge'
</code></pre>

CC BY-SA 4.0
2022-03-18T12:27:46.723Z
2022-03-18T12:27:46.723Z
goose
<p>I need to get all open Merge requests by author and if possible within a time frame. Tried using this command for Github where it works fine -</p>
<pre><code>git ls-remote origin 'pull/*/head'
</code></pre>
<p>But in gitlab, this is not returning anything, please suggest to get all MRs, if possible status = 'opened', 'closed', 'merged' and time frame.</p>

<gitlab><git><github>
How to get all open Merge Requests using git command line?
goose
# How to get all open Merge Requests using git command line?

(Asked by: username_0 on 2022-03-18)

I need to get all open Merge requests by author and if possible within a time frame. Tried using this command for Github where it works fine -
git ls-remote origin 'pull/*/head'

But in gitlab, this is not returning anything, please suggest to get all MRs, if possible status = 'opened', 'closed', 'merged' and time frame.

**Tags:** gitlab, git, github


---

## 1 answers

### Answer by username_0 on 2022-03-18. Score: 0 | Accepted answer

This is the pattern to fetch all Merge Requests from GitLab -
git ls-remote origin 'refs/merge-requests/*/head'

OR
git ls-remote origin 'refs/merge-requests/*/merge'


---

