Session - Pull Requests
We want to push the copy branch to GitHub, make a pull request to merge into main
This open the pull request in GitHub/a browser, select the Create Pull Request button
Draft pull requests
Create pull request and select Draftmain branch can be seen as an extra step, particularly when you are working aloneThere are three options the default being
Create a merge commit creates a new merge commit which isn’t very descriptive in the name
Merge pull request #1 from Letxuga007/new_work
but is recommended as an easier way to debug for when things get muddled
Squash and merge details multiple commits in one
New work (#1) * First commit for quarto document * Removed author
which is a nice way to keep all the commit messages but messages can get long
Squashing
Rebase and merge keeps all the commits as you created them in a linear way
The history is more readable but can be tougher to resolve conflicts
Screenshot of the commits from a rebase merge
Sometimes you need to go back to main to get changes from colleagues or create a new branch:
This does a few things
First find the PR to work on:
Gives you details of what is open as a PR:
Merge pull request will be available straight awaySeveral things gets tidied up all in one function
If you are working on something and change your mind
when in the branch you want to discard:
✔ Switching back to default branch ('main').
✔ Pulling changes from 'origin/main'
✔ Deleting local 'mistake-branch' branch.PR needs to be tidied in GitHub
Local and Remote branches are distinct things so although new_work branch has been deleted and the remote has been merged, the connection in RStudio remains
To tidy, in the Terminal type:
Happy Git and GitHub for the useR by Jenny Bryan
Pull Request Flow with usethis by Garrick Aden-Buie
Happy Git and GitHub for the useR by Jenny Bryan
Pull Request Flow with usethis by Garrick Aden-Buie