-
Notifications
You must be signed in to change notification settings - Fork 0
/
fetchPull.txt
28 lines (18 loc) · 970 Bytes
/
fetchPull.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
remote tracking branch
track work from last branch to current branch last remote branch to curret local branch.
origin/master
when we clone the repo from github then there two reference are there and
one is master and other is origin/master .
master is local repo branch and origin/master is remote repo default branch.
if we add changes and commit then we will get message like this
origin/master is -3 commits behind master branch
git checkout origin/master this will be in deteched head.
Your branch is ahead of 'origin/master' by commit.
if we do git switch <branch name> and that branch is not in local repo but it is in remote repo
then git will create same branch as remote repo branch name.
git pull means apply changes.
git fetch means get changes but not apply changes.
git fetch <remote> for all branches changes
git fetch <remote> <branch name> for particular branch changes
to retrieve the changes we use git pull and git fetch
pull=fetch+merge.