Difference between revisions of "Git/push"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< Git
Jump to navigation Jump to search
(Created page with "'''Action''': updates remote refs using local refs, while sending objects necessary to complete the given refs ==Links== ===Reference=== * [http://kernel.org/pub/software/scm/...")
 
(moved "rules" here from main page)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
'''Action''': updates remote refs using local refs, while sending objects necessary to complete the given refs
 
'''Action''': updates remote refs using local refs, while sending objects necessary to complete the given refs
 +
==Rules==
 +
You can't {{l/same|push}} to a {{l/same|repository}} that has been edited elsewhere; you have to {{l/same|pull}} first, which updates (synchronizes) your local repository from the {{l/same|remote}}. (This does not ''remove'' any files, but may modify files if the same files have been updated on the remote.) Once your local is synchronized with the remote, you can then push it back up.
 +
==Examples==
 +
* '''git push''' {{arg|remote server}} {{arg|branch to push}}
 +
* '''git push''' -u -v {{arg|remote server}} {{arg|branch to push}}
 +
** This version is more verbose; not actually sure what -u does.
 +
Remote server is any server-alias you have set up; "origin" seems to be a default. Branch is typically "master".
 
==Links==
 
==Links==
 
===Reference===
 
===Reference===
 
* [http://kernel.org/pub/software/scm/git/docs/git-push.html manpage @ kernel.org]
 
* [http://kernel.org/pub/software/scm/git/docs/git-push.html manpage @ kernel.org]

Latest revision as of 14:49, 9 March 2015

Action: updates remote refs using local refs, while sending objects necessary to complete the given refs

Rules

You can't push to a repository that has been edited elsewhere; you have to pull first, which updates (synchronizes) your local repository from the remote. (This does not remove any files, but may modify files if the same files have been updated on the remote.) Once your local is synchronized with the remote, you can then push it back up.

Examples

  • git push <remote server> <branch to push>
  • git push -u -v <remote server> <branch to push>
    • This version is more verbose; not actually sure what -u does.

Remote server is any server-alias you have set up; "origin" seems to be a default. Branch is typically "master".

Links

Reference