From 35af224d54c84f284d8bea4d2610ec22175acf4c Mon Sep 17 00:00:00 2001 From: Afraz Hasan Date: Sat, 19 Oct 2019 11:53:16 -0400 Subject: [PATCH 1/4] Initial draft for documentation of git push --- reference/static/commands/tools/gitpush.md | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 reference/static/commands/tools/gitpush.md diff --git a/reference/static/commands/tools/gitpush.md b/reference/static/commands/tools/gitpush.md new file mode 100644 index 0000000..49912a6 --- /dev/null +++ b/reference/static/commands/tools/gitpush.md @@ -0,0 +1,35 @@ +git push +------- + +`git push` is a command to upload local repository content to a remote repository. It's the counterpart to `git fetch`. + +~~~ bash +$ git push origin master +~~~ + +##Basic Usage +`$ git push ` +--- + +### Useful Options / Examples + +##### `git push :` + + To rename a branch, add one more argument to git push separated by a `:`. This pushes the `LOCALBRANCHNAME` to the `REMOTENAME`, but it is renamed to `REMOTEBRANCHNAME` + +##### `git push ` + To push a single tag, use the `git push` command and add your `TAGNAME` to it. + +##### `git push --tags` + To push all your tags, add `--tags` to the `git push` command + + +##### `git push :` + To delete a branch use the above syntax. Note, this is similar to the syntax for renaming a branch (there is a space before the colon). + +##### `git push --force` +Forces the push, even if it results in a non-fast-forward merge. Do not use the `--force` flag unless you're absolutely sure you know what you're doing. + +##### `git push --all` +Use this command to push all of your branches to the specified remote. + From 6431618e962f760159f0533c7fb9bb8dab4fb278 Mon Sep 17 00:00:00 2001 From: Afraz Hasan Date: Sun, 20 Oct 2019 22:25:05 -0400 Subject: [PATCH 2/4] Final documentation for git push with usefulusage cases explained --- reference/static/commands/tools/gitpush.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reference/static/commands/tools/gitpush.md b/reference/static/commands/tools/gitpush.md index 49912a6..882b209 100644 --- a/reference/static/commands/tools/gitpush.md +++ b/reference/static/commands/tools/gitpush.md @@ -33,3 +33,7 @@ Forces the push, even if it results in a non-fast-forward merge. Do not use the ##### `git push --all` Use this command to push all of your branches to the specified remote. +##### `git push --delete` +Use this command to delete all listed references from the remote repository. This can also be done by prefixing all references with a colon. + + From 85e0094e9772c01884806975dbcd4b04235180b2 Mon Sep 17 00:00:00 2001 From: Afraz Hasan Date: Sat, 7 Dec 2019 01:53:43 -0500 Subject: [PATCH 3/4] Fixed syntax error on line 10 according to feedback --- reference/static/commands/tools/gitpush.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/static/commands/tools/gitpush.md b/reference/static/commands/tools/gitpush.md index 882b209..b0df085 100644 --- a/reference/static/commands/tools/gitpush.md +++ b/reference/static/commands/tools/gitpush.md @@ -7,7 +7,7 @@ git push $ git push origin master ~~~ -##Basic Usage +###Basic Usage `$ git push ` --- From 65ef9f83001287e564078f258521ed60741a7cf9 Mon Sep 17 00:00:00 2001 From: Afraz Hasan Date: Sat, 7 Dec 2019 01:57:52 -0500 Subject: [PATCH 4/4] Fixed syntax error on line 10 --- reference/static/commands/tools/gitpush.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/static/commands/tools/gitpush.md b/reference/static/commands/tools/gitpush.md index b0df085..8f4e7a9 100644 --- a/reference/static/commands/tools/gitpush.md +++ b/reference/static/commands/tools/gitpush.md @@ -7,7 +7,7 @@ git push $ git push origin master ~~~ -###Basic Usage +## Basic Usage `$ git push ` ---