aver impostato il monte di quel ramo
(vedi:
git branch -f --track my_local_branch origin/my_remote_branch
# OR (if my_local_branch is currently checked out):
$ git branch --set-upstream-to my_local_branch origin/my_remote_branch
(git branch -f --track
Won lavorare se il b ranch è verificato: utilizzare il secondo comando git branch --set-upstream
, invece, o si otterrebbe "fatal: Cannot force update the current branch.
")
Ciò significa che il ramo è already configured con:
branch.my_local_branch.remote origin
branch.my_local_branch.merge my_remote_branch
Git ha già tutte le informazioni necessarie.
In tal caso:
# if you weren't already on my_local_branch branch:
git checkout my_local_branch
# then:
git pull
è sufficiente.
Se non avessi stabilire quel rapporto ramo a monte quando si trattava di spingere il vostro 'my_local_branch
', quindi un semplice git push -u origin my_local_branch:my_remote_branch
sarebbe stato sufficiente a spingere e impostare il ramo a monte.
Dopodiché, per i tiri/spinte successivi, git pull
o git push
, sarebbe stato di nuovo sufficiente.
L'OP indica che stanno già monitorando il ramo remoto. – Amber
@Amber quindi la mia risposta: 'git pull' è sufficiente. – VonC
Il primo comando 'git branch -f --track master origin/master' restituisce un errore:' fatale: impossibile forzare l'aggiornamento del ramo corrente. –