You can read more fault settings by reading git help config or an online version of the git-config(1) Manual Page. The remote is determined by the branch's branch.remote setting, and defaults to the origin repo otherwise.īefore Git version 2.0, the default setting, matching, basically just pushes all of your local branches to branches with the same name on the remote (which defaults to origin). When both the remote and the branch are omitted, the behavior of just git push -force is determined by your fault Git config settings: git push -forceĪs of Git 2.0, the default setting, simple, will basically just push your current branch to its upstream remote counter-part. The settings in question are the remote.push and fault settings (see below). While prior to 2.0, new repos will have default settings to push multiple local branches. In Git versions after 2.0, a new repo will have default settings to push the currently checked-out branch: git push -force When the branch to push branch is omitted, Git will figure it out based on your config settings. The -f flag is the short version of -force git push -force You can completely specify specific branches and a remote. Force pushing details Specifying the remote and branch Make sure that this is what you really want to do before you use it, otherwise you may overwrite commits that you actually want to keep. Warning: force pushing will overwrite the remote branch with the state of the branch that you're pushing. If you want a more detailed explanation of each command, then see my long answers section below. You basically have 4 different options for force pushing with Git: git push -f If you want a more detailed explanation of each of the following commands, then see my details section below. What you basically want to do is to force push your local branch, in order to overwrite the remote one.
0 Comments
Leave a Reply. |