赞
踩
有时需要将指定的本地分支强制push到远程分支,可以在以下命令基础上加-f,强制执行。
git push origin +dev:master
Meaning: Git push to remote origin/master from local dev
以上命令的含义是push 到远程origin的master分支(从本地的dev分支)。
参考官方文档:
以下是官方详解:(摘自官方文档)
git push [--all | --mirror | --tags] [--follow-tags] [--atomic] [-n | --dry-run] [--receive-pack=<git-receive-pack>]
[--repo=<repository>] [-f | --force] [-d | --delete] [--prune] [-v | --verbose]
[-u | --set-upstream] [-o <string> | --push-option=<string>]
[--[no-]signed|--signed=(true|false|if-asked)]
[--force-with-lease[=<refname>[:<expect>]] [--force-if-includes]]
[--no-verify] [<repository> [<refspec>…]]<repository>
The "remote" repository that is destination of a push operation. This parameter can be either a URL (see the section GIT URLS below) or the name of a remote (see the section REMOTES below).
<refspec>…
Specify what destination ref to update with what source object. The format of a <refspec> parameter is an optional plus +, followed by the source object <src>, followed by a colon :, followed by the destination ref <dst>.
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。