<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE sect1 SYSTEM "../../../dtd/dblite.dtd">
<sect1 id="tgit-dug-push">
	<title>Push</title>
	<?dbhh topicname="HIDD_PUSH"?>
	<indexterm>
		<primary>Push</primary>
	</indexterm>
	<para>
		This section talks about how to push (i.e., send) changes to another repository.
	</para>
	<para>
		In order to perform a push open the push dialog using
		<menuchoice>
			<guimenu>TortoiseGit
			</guimenu>
			<guimenuitem>Push...
			</guimenuitem>
		</menuchoice>.
		Pushing changes is also possible using the Sync dialog (cf. <xref linkend="tgit-dug-sync"/>), however, there you have less options, but the sync dialog allows you to initiate other operations such as pulling and to see diffs and changes.
	</para>
	<para>
		<figure id="tgit-dug-push-dia-pushdialog">
			<title>Push dialog</title>
			<graphic fileref="../images/GitPush.png"/>
		</figure>
	</para>
	<sect2>
		<title>Branch</title>
		<para>
			<guilabel>Local</guilabel>: The source branch which will be pushed to the other repository. If the current branch or the selected local branch has a remote tracked branch set, the remote branch and remote repository are automatically selected. A remote tracked branch can be set using the reference browser (cf. <xref linkend="tgit-dug-browse-ref"/>) or by using <guilabel>Set upstream/track remote branch</guilabel>. This can be overridden in this dialog by using one of the <guilabel>Always push to the selected remote ...</guilabel> options, so that for pushing a different branch is selected automatically as for merging and pulling.
		</para>
		<para>
			<guilabel>Remote</guilabel>: The remote branch of the other repository.
		</para>
	</sect2>
	<sect2>
		<title>Destination</title>
		<para>
			<guilabel>Remote</guilabel>: Choose an already configured remote repository.
		</para>
		<para>
			<guilabel>Arbitrary URL</guilabel>: The URL of a remote repository.
		</para>
		<para>
			You must push change to a bare repository.
			Pushing changes to repository which has a working tree can lead to unexpected results.
		</para>
	</sect2>
	<sect2>
		<title>Options</title>
		<para>
			<guilabel>force with lease</guilabel>
			This allows remote repository to accept a safer non-fast-forward push. This can cause the remote repository to lose commits; use it with care.
			This can prevent from losing unknown changes from other people on the remote.
			It checks if the server branch points to the same commit as the remote-tracking branch (known changes).
			If yes, a force push will be performed. Otherwise it will be rejected.
			Since git does not have remote-tracking tags, tags cannot be overwritten using this option.
			This passes <literal>--force-with-lease</literal> option of <literal>git push</literal> command.
		</para>
		<para>
			<guilabel>force</guilabel>
			This allows remote repository to accept an unsafe non-fast-forward push. This can cause the remote repository to lose commits; use it with care.
			This does not check any server commits, so it is possible to lose unknown changes on the remote.
			Use this option with <guilabel>Include Tags</guilabel> to overwrite tags.
			This passes the traditional <literal>--force</literal> option of <literal>git push</literal> command.
		</para>
		<para>
			<guilabel>Include Tags</guilabel>
			Also push tags to remote repository.
		</para>
		<para>
			<guilabel>Autoload Putty Key</guilabel>
		</para>
		<tip>
			<para>You can find more information about PuTTY and using SSH keys at <xref linkend="tgit-ssh-howto"/>. There is also explained how you can use several accounts at the same time for a remote.</para>
		</tip>
		<para>
			<guilabel>Set upstream/track remote branch</guilabel>:
			After a successful push, the tracking relationship will be set between the pushed local branch and its remote tracking branch. This will select the remote branch automatically for pulling/pushing and merging.
		</para>
		<para>
			<guilabel>Always push to the selected remote archive for this local branch</guilabel>
		</para>
		<para>
			<guilabel>Always push to the selected remote branch for this local branch</guilabel>
		</para>
		<para>
			<guilabel>Recurse submodule</guilabel>
			<option>None</option>: No checking.
			<option>Check</option>: Checks if the bounded commits of all submodules are present on the remote repositories. If any of the submodules are not pushed, the super project push will fail.
			<option>On-demand</option>: Checks if the bounded commits of all submodules are present on the remote repositories. If the submodules are not pushed yet, it will try to push them.
		</para>
	</sect2>
	<para>
		You can find more information at <gitdoclink cmd="git-push" section="1"/>.
	</para>
</sect1>
