No se pueden enviar cambios locales a una twig remota existente

Hay una twig remota llamada "my-remote" a la que había presionado previamente sin problema. A partir de hoy, no puedo presionar y recibo diferentes errores.

El primer error que obtuve fue:

hint: Updates were rejected because a pushed branch tip is behind its remote hint: counterpart. If you did not intend to push that branch, you may want to hint: specify branches to push or set the 'push.default' configuration hint: variable to 'current' or 'upstream' to push only the current branch. 

Hice algunas investigaciones y ejecuté esto esperando que resolvería el problema:

 git config push.default tracking 

después de correr, ejecuté el push nuevamente:

 git push https://github.com/someurl/mybranch.git 

Tuve el siguiente error:

 pushing to remote 'https://github.com/someurl/mybranch.git', which is not the upstream of your current branch 'my-remote', without telling me what to push to update which remote branch. 

He intentado ejecutar esto:

 git push master:my-remote https://github.com/someurl/mybranch.git 

pero me dice que:

 fatal: remote part of refspec is not a valid name in https://github.com/someurl/mybranch.git 

Si desea insert su twig principal en la twig remota my-remote, la syntax correcta sería:

  git push https://github.com/someurl/mybranch.git master:my-remote 

(primero: reference de repository remoto, refspec, de la página de manual de git push )

En cuanto a su primer post de error, si realmente no le dijo que se fusionara, entonces podría ser necesario un git pull --rebase .
O al less un:

  git config --global push.default current 

(Como se menciona en " Configurar Git para que solo presione la twig actual ").

Si se encuentra en la twig local ' my-remote ' (que es el caso, de acuerdo con el command), puede asegurarse de que la twig ascendente se establece haciendo un:

 git push -u https://github.com/someurl/mybranch.git my-remote:my-remote 

Hay 9 pasos para empujar a un repository git existente.

Intenté "git push –set-upstream origin master" y obtuve el siguiente error:

 C:\Users\User\Documents\Visual Studio 2013\Projects\app\User-app-40d72a288916>git push --set-upstream origin master Password for 'https://[email protected]': To https://[email protected]/User/app.git ! [rejected] master -> master (fetch first) error: failed to push some refs to 'https://[email protected]/User/ app.git' hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused by another repository pushing hint: to the same ref. You may want to first merge the remote changes (eg, hint: 'git pull') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. 

Luego probé "git pull" y obtuve los últimos cambios:

 C:\Users\User\Documents\Visual Studio 2013\Projects\app\User-app-40d72a288916>git pull Password for 'https://[email protected]': warning: no common commits remote: Counting objects: 344, done. remote: Compressing objects: 100% (275/275), done. remote: Total 344 (delta 45), reused 336 (delta 41) Receiving objects: 100% (344/344), 15.91 MiB | 43.00 KiB/s, done. Resolving deltas: 100% (45/45), done. From https://bitbucket.org/User/app * [new branch] master -> origin/master There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details git pull <remote> <branch> 

Si desea establecer la información de seguimiento para esta sucursal, puede hacerlo con:

 git branch --set-upstream-to=origin/<branch> master 

Hice un "git push" y los cambios fallaron:

 C:\Users\User\Documents\Visual Studio 2013\Projects\app\User-app-40d72a288916>git push origin master Password for 'https://[email protected]': To https://[email protected]/User/app.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://[email protected]/User/ app.git' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Merge the remote changes (eg 'git pull') hint: before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. 

"git add -A" y "git commit" no funcionaron porque no había nada que comprometer.

 C:\Users\User\Documents\Visual Studio 2013\Projects\app\User-app-40d72a288916>git add -A C:\Users\User\Documents\Visual Studio 2013\Projects\app\User-app-40d72a288916>git commit 

En la twig principal no hay nada que confirmar, el directory de trabajo está limpio

"git branch –set-upstream-to = origin / master master" parecía hacer el truco.

 C:\Users\User\Documents\Visual Studio 2013\Projects\app\User-app-40d72a288916>git branch --set-upstream-to=origin/master master Branch master set up to track remote branch master from origin. 

Sin embargo, un "maestro de origen de git push" no funcionó porque la punta de la twig actual está detrás de su contraparte remota.

 C:\Users\User\Documents\Visual Studio 2013\Projects\app\User-app-40d72a288916>git push origin master Password for 'https://[email protected]': To https://[email protected]/User/app.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://[email protected]/User/ app.git' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Merge the remote changes (eg 'git pull') hint: before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. 

Se necesitaba un "git pull" para fusionar los repos.

 C:\Users\User\Documents\Visual Studio 2013\Projects\app\User-app-40d72a288916>git pull Password for 'https://[email protected]': Merge made by the 'recursive' strategy. 

Después de ejecutar el "git pull", "git push origin master" era exactamente lo que se necesitaba para que la synchronization orderada funcionara en el plugin de git de Visual Studio.

 C:\Users\User\Documents\Visual Studio 2013\Projects\app\User-app-40d72a288916>git push origin master Password for 'https://[email protected]': Counting objects: 5, done. Delta compression using up to 8 threads. Compressing objects: 100% (4/4), done. Writing objects: 100% (4/4), 539 bytes | 0 bytes/s, done. Total 4 (delta 2), reused 0 (delta 0) To https://[email protected]/User/app.git 40d72a2..9748b8b master -> master C:\Users\User\Documents\Visual Studio 2013\Projects\app\User-app-40d72a288916>