git push学习笔记


<repository>

Remote repository as the destination of the push operation. Can be both URL or Name of a remote repo.

<refspec>

Specify the destination ref and the source object which u want to push. Eg: I wanna push this_local_branch to that_remote_branch. Source object here is 'this local branch' and the destination ref is ' that remote branch'.

the format of a <refspec> is :

optional '+', followed by the source object <src>, followed by a colon ':', followed by the destination ref <dst>.

<src> is the name of the branch which you wanna push, can also be any arbitrary "SHA-1 expressions" eg. master-4 or HEAD.

<dst> is the name of the remote ref which you wanna push to and can only use name, not arbitrary "SHA-1 expressions

git push this_local_branch : that_remote_branch


git push updates remote branch with local branch. 

The default repository is 'origin' if there is no specific <repository> argument given in the command line or the branch.*.remote configuration is missing for the current branch to tell where to push.

--all //push all branches

--prune //remove remote branches if there is no corresponding local branch with the same name

--mirror // mirroring local to remote including newly created refs and locally delated refs

-n, --dry-run // do push operations without real push

-d, --delete // delete all listed refs from remote repo

--tags ??? // push with tag to remote repo?

--follow-tags ??


--force-with-lease //for all remote refs, only do push after check if the remote ref's current value is as expected(no change since your last commit)

--force-with-lease=<refname> for specified remote branch, and do push after check current value

--force-with-lease=<refname>:<expect>  //



-f, --force //


最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容