‘" t ." Title: git-to-master ." Author: [see the “AUTHOR” section] ." Generator: DocBook XSL Stylesheets v1.78.1 <docbook.sf.net/> ." Date: 04/20/2016 ." Manual: \ & ." Source: \ & ." Language: English ." .TH “GIT-TO-MASTER” “1” “04/20/2016” “\ &” “\ &” ." —————————————————————– ." * Define some portability stuff ." —————————————————————– ." ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ." bugs.debian.org/507673 ." lists.gnu.org/archive/html/groff/2009-02/msg00013.html ." ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie n(.g .ds Aq (aq .el .ds Aq ’ ." —————————————————————– ." * set default formatting ." —————————————————————– ." disable hyphenation .nh ." disable justification (adjust text to left margin only) .ad l ." —————————————————————– ." * MAIN CONTENT STARTS HERE * ." —————————————————————– .SH “NAME” git-to-master - Rebase against the integration branch, then pushes to it&. .SH “SYNOPSIS” .sp fIgit-to-masterfR [fIOPTIONSfR] [fIserver/pull_request_numberfR | fIpull_request_numberfR] .SH “DESCRIPTION” .sp fIgit-to-master(1)fR fetches the latest changes from the server, rebases against the integration branch, pushes to the integration branch, then does housecleaning&. .sp If there is a problem, such as a merge conflict, this tries to resolve it automatically&. If it can not do so safely in an automated way, if tells you the steps involved for doing so manually&. .sp “Housecleaning” includes such things as closing any Pull Request that may exist for the branch, removing the (now obsolete) local and remote feature branches, and then “parking” on the special “fIfIparkingfRfR” branch&. .sp Work is not expected to be done on the “fIfIparkingfRfR” branch, but any that is done is brought over to a newly created feature branch when you do fIgit-new-fb(1)fR&. .sp It(cqs assumed that you fBneverfR do any work directly on the integration branch: everything is done on a feature branch&. In addition to being a much safer and more flexible way of working in general, it is also a requirement to take advantage of pull request functionality&. (See fIgit-pull-req(1)fR&.) .sp If a number is given, or a number with a server preceding it (e&.g&., “origin/23”), then this assumes that the number refers to an existing pull request identified by that number&. In that case, the branch associated with the HEAD of the pull request is checked out before doing the rest of the “to-master”&. .SH “EXAMPLE WITHOUT PULL REQUEST” .sp Assuming that the current branch is called “interesting_changes” and the integration branch on the server is “master”, typing “fBgit to-masterfR” will do roughly the following for you: .sp .if n {\ .RS 4 .} .nf $ git fetch -p $ git rebase origin/master $ git push origin interesting_changes:master # close pull request if one exists $ git checkout -b parking origin/master $ git branch -d interesting_changes $ git push origin --delete interesting_changes .fi .if n {\ .RE .} .sp If you use the --keep option, then the process stops after the first “push”&. .SH “EXAMPLE WITH PULL REQUEST” .sp Assuming that the pull request number is 493, its branch name is “interesting_changes” and the integration branch on the server is “master”, typing “fBgit to-master 493fR” will do roughly the following for you: .sp .if n {\ .RS 4 .} .nf $ git fetch -p # looks up the information for pull request 493 $ git checkout -b interesting_changes origin/interesting_changes $ git rebase origin/master $ git push origin interesting_changes:master # close pull request $ git checkout -b parking origin/master $ git branch -d interesting_changes $ git push origin --delete interesting_changes .fi .if n {\ .RE .} .sp If you would like the review the changes locally first, use fIgit-pull-req(1)fR instead&. .SH “OPTIONS” .sp The effective default is “fBgit to-master --infofR”&. .PP fB-k, --keepfR .RS 4 Don(cqt do any “cleanup&.” It keeps the current local and remote branches, and does not close any outstanding pull requests&. .RE .PP fB--infofR .RS 4 Informational messages; show the major things this is doing (fBdefault: truefR) .RE .PP fB-q, --quietfR .RS 4 Quiet messages; only show errors .RE .PP fB-v, --verbosefR .RS 4 Verbose messages; show lots of details on what this is doing .RE .PP fB--versionfR .RS 4 Print version and exit .RE .SH “CONFIGURATION” .sp Options for fIgit-to-master(1)fR are set using fIgit-config(1)fR&. .PP fBgitProcess&.remoteNamefR .RS 4 Allows you to explicitly set the remote server name to use&. Defaults to the first server name reported by fIgit-remote(1)fR (which is typically “origin” since most projects have a single remote)&. .RE .PP fBgitProcess&.integrationBranchfR .RS 4 Allows you to explicitly set the integration branch to use&. Defaults to “master”&. .RE .PP fBgitProcess&.github&.authtokenfR .RS 4 Not meant to be set manually, this is the OAuth token used to communicate with the GitHub server&. If it is not set, the user will be prompted for their credentials&. .RE .PP fBgithub&.userfR .RS 4 If OAuth needs to prompt for credentials, if this value is set then it is used as the username&. Otherwise it is unused&. .RE .SH “CONTROL FILES” .PP fBgitprocess-sync-fR*fB--fR* .RS 4 To help make the process simpler and more reliable, fIgit-to-master(1)fR will read a file in the “fI&.gitfR” directory that contains the SHA-1 of the last successful sync to the server&. (See fIgit-sync(1)fR&.) As part of its normal “housekeeping” fIgit-to-master(1)fR will remove the file if fB--keepfR is not specified&. .RE .SH “GITHUB SUPPORT” .sp To know which GitHub URL to use for pull request support, the value of fIgitProcess&.remoteNamefR is resolved to the underlying server name/IP&. (That includes “aliased” names in a fIssh_config(5)fR file&.) If it(cqs github&.com, then the public GitHub&.com API is used&. Otherwise it(cqs assumed that the server is GitHub Enterprise and that set of URLs is used&. .SH “SEE ALSO” .sp fBgit-processfR(1), fBgit-syncfR(1), fBgit-new-fbfR(1), fBgit-pull-reqfR(1) .SH “BUGS” .sp Known bug list: github&.com/jdigger/git-process/issues?state=open .SH “AUTHOR” .sp git-to-master has been written primarily by Jim Moore&. .SH “RESOURCES” .sp Main web site: github&.com/jdigger/git-process