327
Examples
328
--------
329
330
-git push::
330
+`git push`::
331
Works like `git push <remote>`, where <remote> is the
332
current branch's remote (or `origin`, if no remote is
333
configured for the current branch).
334
335
-git push origin::
335
+`git push origin`::
336
Without additional configuration, works like
337
`git push origin :`.
338
+
344
the ones in the examples below) can be configured as the default for
345
`git push origin`.
346
347
-git push origin :::
347
+`git push origin :`::
348
Push "matching" branches to `origin`. See
349
<refspec> in the <<OPTIONS,OPTIONS>> section above for a
350
description of "matching" branches.
351
352
-git push origin master::
352
+`git push origin master`::
353
Find a ref that matches `master` in the source repository
354
(most likely, it would find `refs/heads/master`), and update
355
the same ref (e.g. `refs/heads/master`) in `origin` repository
356
with it. If `master` did not exist remotely, it would be
357
created.
358
359
-git push origin HEAD::
359
+`git push origin HEAD`::
360
A handy way to push the current branch to the same name on the
361
remote.
362
363
-git push origin master:satellite/master dev:satellite/dev::
363
+`git push origin master:satellite/master dev:satellite/dev`::
364
Use the source ref that matches `master` (e.g. `refs/heads/master`)
365
to update the ref that matches `satellite/master` (most probably
366
`refs/remotes/satellite/master`) in the `origin` repository, then
367
do the same for `dev` and `satellite/dev`.
368
369
-git push origin HEAD:master::
369
+`git push origin HEAD:master`::
370
Push the current branch to the remote ref matching `master` in the
371
`origin` repository. This form is convenient to push the current
372
branch without thinking about its local name.
373
374
-git push origin master:refs/heads/experimental::
374
+`git push origin master:refs/heads/experimental`::
375
Create the branch `experimental` in the `origin` repository
376
by copying the current `master` branch. This form is only
377
needed to create a new branch or tag in the remote repository when
378
the local name and the remote name are different; otherwise,
379
the ref name on its own will work.
380
381
-git push origin :experimental::
381
+`git push origin :experimental`::
382
Find a ref that matches `experimental` in the `origin` repository
383
(e.g. `refs/heads/experimental`), and delete it.
384
385
-git push origin {plus}dev:master::
385
+`git push origin {plus}dev:master`::
386
Update the origin repository's master branch with the dev branch,
387
allowing non-fast-forward updates. *This can leave unreferenced
388
commits dangling in the origin repository.* Consider the