Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gitpush #216

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions reference/static/commands/tools/gitpush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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 <remote> <branch>`
---

### Useful Options / Examples

##### `git push <REMOTENAME> <LOCALBRANCHNAME>:<REMOTEBRANCHNAME>`

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 <REMOTENAME> <TAGNAME>`
To push a single tag, use the `git push` command and add your `TAGNAME` to it.

##### `git push <REMOTENAME> --tags`
To push all your tags, add `--tags` to the `git push` command


##### `git push <REMOTENAME> :<BRANCHNAME>`
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 <remote> --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 <remote> --all`
Use this command to push all of your branches to the specified remote.

##### `git push <remote> --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.