it is a bad way to do code reviews after pull request has been initiated. sometimes we want to do code reviews before the whole thing is ready for integration. is there any tools out there that will allow code review without pull request? I prefer cloud based solution such as reviewable but it only works with pull request...
Fastforward to 2019. Github now offers "draft pull requests":
https://github.blog/2019-02-14-introducing-draft-pull-requests/
WIP (Work in Progress) pull requests are pretty common. GitHub doesn't have a built-in feature like GitLab or Gerrit have, but it's pretty easy to just do this by consensus: Open a PR that's prefixed with WIP: to indicate it isn't ready for being merged, but is open to feedback, and keep updating it (with git push --force most probably) as you go. Once you're done, you can remove the WIP: prefix.
EDIT:
While it isn't a built-in feature, the WIP third party app seems to help automate this for you, and prevent you from merging a WIP branch by mistake.
Related
I am working on a repo where I am the owner and only author in it.
I want to have in my repo the same behavior as I would when working with a team that protects my branch from direct commits as they must go through a Pull Request. The reason for doing so is to protect from my own mistakes as I sometimes go back to main branch and accidentally push code to it. I want only code that passed through a Pull Request to be able to be merged to main branch.
In order to achieve such behavior I added the following rule to my main branch -
Which is almost what I need, expect that I am locked without the ability to approve my PR's as there is a message I get saying authors of the PR can't approve their PR's - a logical error nonetheless, but if I am working alone in the repo this is not what I am looking for.
How can I achieve what I am looking for?
Simply disable "Require approvals" (the second checkbox in your screenshot), you will still be required to create a PR.
You can merge your own PRs, the only thing you cannot do is to approve your own work (after all: why would you? Hopefully you deem your own changes good!)
On a Github project, I see a guy made a pull request in Pull Requests section, but I find he made many mistakes so his code need to be corrected. Instead of asking him to change his code, is it possible to do it by myself (that is, I want to correct his code by myself)? and how?
I'm also a member of that project, and I'm new :)
Enabling repository maintainer permissions on existing pull requests
Pull request creators can give these permissions on each of their pull requests when they initially create a pull request from a fork or after they have created the pull request.
On GitHub, navigate to the main page of the upstream repository of your pull request.
In the list of pull requests, navigate to the pull request that you'd like to allow commits on.
In the right sidebar of your pull request, select Allow edits from maintainers. You can change these permissions at any time by unselecting this option.
More details on github help page: Allowing changes to a pull request branch created from a fork
TL;DR
Author of PR can modify an existing pull request to let repository maintainers make commits to your branch.
In order to allow you to make commits to others PR - the author has to set checkbox from the left:
Assuming the original author is responsive enough, it’s always better to ask them to fix it (unless the change is an obvious typo fix, maybe). They might have a reason for writing it the way they did.
If the author isn’t responsive and you’re deciding whether to fix it in place or with a new commit, ask yourself which way the history reads more clearly. If the commit would introduce a regression, you should probably fix it in place (to avoid breaking bisectability). If it handles some cases and you just want to add more cases without significantly changing the existing code, it might be better to add a new commit.
If you do amend the existing commit in any way, make sure to leave a note in the commit message explaining what you changed. One typical style is to leave a note in square brackets, grouped with any Signed-off-by: lines (if applicable):
[your.email#example.com: Refactor new cases into a function for clarity]
For example: linux.git commit b44129b3.
via https://www.quora.com/GitHub-Is-it-bad-etiquette-to-change-someones-pull-request-before-committing
I've got my first repo that people are interested in contributing to, but I'm totally lost on how to set up the repo so that it respects the Git Flow methodology I've been using while coding by myself.
What do I need to set up? Should I set the default branch to develop instead of master? Do I just need to instruct contributors that they need to use Git Flow and please create their feature under feature/, and submit PRs that way?
Okay the following are my personal thoughts and others might have different ideas :)
I always set the default branch to develop.
I manually do the PR's from github.
I select command line instructions in the PR and download the patch.
I create a feature branch myself, apply the downloaded patch, check the work and fix things if needed (code styling for example), and finish the feature.
Like I said, others might have different ideas about it, but this works for me.
I forked a repo on GitHub, made and pushed changes to my version, and now want to send a pull request to the original repo.
How can I send a pull request with changes affecting a single file and not include the commits and changes done on the other files?
You now (January 2015) can do it directly from the GitHub web interface.
See "Quick Pull Requests":
When using your browser to edit a file on GitHub.com, the web-based commit composer lets you quickly propose a change to a new branch and then immediately open a pull request for discussion and review:
Reducing the time it takes to open a pull request lowers the contribution barrier, and having this workflow available entirely within the browser makes collaboration more approachable for people with all technical skill levels.
Create a new branch from origin/master, commit the right changes to it (you can use git cherry-pick to copy commits among branches) and create a pull request of that branch.
Is there a way to tell travis to build a specific SHA or the HEAD of a pull request that it might have previously missed (ie if the webhook failed to fire or get picked up by travis)?
I could push a new commit to that pull request, but a method that doesn't involve changing the branch would be better, either via the travis UI, or travis' or github's APIs.
What I've found works is to close the PR in GitHub, then immediately re-open it. That should re-trigger the hook.
There's a feature request open for this: https://github.com/travis-ci/travis-ci/issues/895
But for the time being, there's no way to do this.
Also found that if you own the repository, you can mark the pull-request as closed then mark it as open and you will trigger a new build.