문제

From one of most followed blogs, When you do git fetch, Git gathers any commits from the target branch that do not exist in your current branch and stores them in your local repo. However, it does not merge them with your current branch.

After fetching all the commits, where does git store all these commits (since, it's not merging them with my local branch) and how does git repo history changes when i do git fetch?

도움이 되었습니까?

해결책

It stores them in exactly the same way as it stores any other commit.

Git commits are not stored in a branch; rather, a branch is just a pointer to a specific commit.

다른 팁

Usually it is handy to specify the branches explicitly. For example,

git fetch /path/to/repo master:sometopic

would fetch the master branch from repository in /path/to/repo and store is as branch sometopic in your local repository.

Your local master branch isn't affected by the fetch at all.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top