[sakai-core-team] Question about Pull requests

Noah Botimer botimer at umich.edu
Mon Feb 9 12:19:51 PST 2015


It's worth mentioning: any time you are planning to use --force, double-check your work. You could probably recover from a mistake, but it can be a lot of work.

Since we are recommending that feature branches are rebased to include updates, it is good to get in the habit of being explicit. That is, include the remote name and branch name as a safety check, and try once before forcing. The various versions of the git clients have different defaults, you may not have your complete config on whatever machine you're currently using, or remote tracking might not be what you assumed for a particular branch.

Use this:

git push remote branch-name
 ### Look at the big, nasty error message about divergent branches
 ### Make sure this force is really what you want
git push origin branch-name --force

Instead of:

git push --force

The latter will cost you karma points and major fixup time eventually, dwarfing the few seconds of typing you saved with the short form.

Thanks,
-Noah

On Feb 9, 2015, at 2:55 PM, Brian Jones wrote:

> Hey Neal,
> 
>> I made a pull request off a branch from my clone of Sakai project and
>> then had a suggestion to change my pull request. I made the update in 
>> my branch and Git (or Github) seems to have automatically squashed my
>> commits together in the one pull request, which is a good thing.
> 
> Not quite. It's automatically updated the PR, but you've made several 
> commits (3 in total), that should be squashed into 1. You can refer to 
> step 6c in  https://confluence.sakaiproject.org/display/SAKDEV/Git+Setup 
> to walk you through squashing commits.
> 
>> I don't need to merge my change back into my clone of Sakai project,
>> just after the PR is merged, I can switch my local branch back to
>> origin and git pull upstream master, and then I'm all synche'd up and 
>> all is good?
> 
> Correct, after the PR is merged, you can just switch back to your master 
> branch and do the git pull upstream master && git push origin master to 
> both update your fork on your local machine and your fork in github.
> 
> Hope this helps :)
> 
> Brian Jones
> Programmer/Analyst
> Information Technology Services
> Support Services Building, Suite 4300
> Western University
> (519) 661-2111 x86969
> bjones86 at uwo.ca
> _______________________________________________
> sakai-core-team mailing list
> sakai-core-team at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-core-team



More information about the sakai-core-team mailing list