Does git pull execute all monitored branches?

For example, I keep track of 3 locally deleted branches, master, branch1, branch2.

If I'm on a branch master, whether the change git pull fetchand mergeon each of the branches?

I think I could build an experiment too ...

+4
source share
3 answers

The short answer is β€œno” - or maybe even β€œno and yes” if you read only the title of your question, but this is somewhat misleading.

A stretching script allows parameters, and many of them have interesting (and confusing and potentially very unattractive) effects.

, git pull git fetch, git merge. 1pull script fetch. , git fetch origin br, fetch (origin) br "refspec". git predating 1.8.4 git fetch , 1.8.4 br origin/br ( , origin).

, git fetch refspec , 2 " ". , git fetch ( , origin), git fetch origin origin, (1.8.4 ) git. ( git , pull script .)

, origin/*, pull script git merge. git , , " " 3 . , , master, origin master, git git merge, , , origin/master ( ).

: "refspec"

"refspec" , .

"refspec" , master:master, develop:develop ..

, , : . - , - , , .

: git push origin master:master . " , , origin -, , master". HEAD: git push origin HEAD:master " , , origin master".

git fetch , origin/ ( ) , . master, origin/master . , git fetch origin master:origin/master .. 4 git fetch origin master:master, () , . 5

fetch vs pull. , " " refspec. - , master. , : fetch " master, , SHA-1". push " master master".

, git, git fetch (, , ), fetch , ( ) git FETCH_HEAD. git git git fetch =, , .

: git pull origin master branch ( )

git fetch , ( git 1.8.4 ). git pull , .

fetch . merge .

pull script git merge . git " ". , . .

git fetch, , git merge git rebase. , .


1 git rebase, . Rebasing , . : git fetch, git rebase git merge , , git. , , , , .

2 , , fetch = . origin fetch = +refs/heads/*:refs/remotes/origin/*, git, origin/whatever.

3 " ", " ", - git pull SHA-1, FETCH_HEAD, git fetch pull script. origin master origin/master, origin/master; branch.master.remote = origin branch.master.merge = master. git , origin/master , - ; , script FETCH_HEAD.

, , um, "", , git "".

4 , +: " " , " " ", fetch = . " force", , . fetch = , , origin/something * .

5 , . git 30 . " " .

+8

. git-pull . , pull .

+2

You can use either git pull --allto pull out all monitored remote branches or git fetch --allto get them, and decide later how to proceed. Keep in mind that traction usually automatically combines any changes, and rarely do you want to.

+1
source

Source: https://habr.com/ru/post/1613567/


All Articles