# Git Pull Request Workflow

**URL:** <https://community.tmpdir.org/t/git-pull-request-workflow/1116>\
**Category:** Tools\
**Tags:** git, workflow\
**Created:** [August 7, 2023, 7:25pm UTC](https://community.tmpdir.org/t/git-pull-request-workflow/1116 "2023-08-07T19:25:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cbrake](https://community.tmpdir.org/user_avatar/community.tmpdir.org/cbrake/32/3_2.png) [@cbrake](https://community.tmpdir.org/u/cbrake)\
**Post date:** [August 7, 2023, 7:25pm UTC](https://community.tmpdir.org/t/git-pull-request-workflow/1116/1 "2023-08-07T19:25:30Z")

</div>

With tools like Github, Gitlab, and Gitea, pull request (PR) workflow is often recommended. This is how I do it:

- `git checkout -b cbrake/main`
- make changes
- `git add/commit`
- `git push -u origin HEAD`

(substitute your user name and target branch)

When you push your branch, Gitlab and Gitea will give you nice links to click on to open a PR.

Why use PRs instead of committing directly to `main`?

- it groups your commits for better organization (a feature can be a one PR)
- provides email notifications to the rest of the team on activity
- provides an opportunity to review and discuss the changes

Most Git repos I work on are configured to block commits directly to the main branch forcing everything to go through PRs. Even for solo development, PRs (like Git itself) are a useful tool to organize your work.

---

<div class="post-metadata">

**Author:** ![nicstarke](https://community.tmpdir.org/user_avatar/community.tmpdir.org/nicstarke/32/2231_2.png) [@nicstarke](https://community.tmpdir.org/u/nicstarke)\
**Post date:** [August 24, 2023, 3:34pm UTC](https://community.tmpdir.org/t/git-pull-request-workflow/1116/2 "2023-08-24T15:34:52Z")

</div>

Is it common to use PRs?  
In every role I’ve had it has always been “just merge your feature branch to the dev branch when you are done, no PR required”

---

<div class="post-metadata">

**Author:** ![cbrake](https://community.tmpdir.org/user_avatar/community.tmpdir.org/cbrake/32/3_2.png) [@cbrake](https://community.tmpdir.org/u/cbrake)\
**Post date:** [August 24, 2023, 7:00pm UTC](https://community.tmpdir.org/t/git-pull-request-workflow/1116/3 "2023-08-24T19:00:10Z")

</div>

I use PRs all projects – even those where I am the only contributor. I think the benefits outweigh the overhead.
