質問

After doing a "git fetch origin" to pull in a remote branch added my a colleague, I did "git checkout .

This output: Branch set up to track remote branch from origin. Switched to a new branch ""

I have a post-merge script to run SQL scripts merged into my local repository. HOWEVER, when I ran my git checkout , I pulled in some SQL files and my script did not run, meaninng no merge was done.

How does it get the remote branch onto the local branch if it isn't merging?

Thanks in advance!

役に立ちましたか?

解決

A git fetch does not merge. It does not update your working copy. A merge is automatic when you do a git pull.

So creating a new remote-tracking branch by fetching does not actually merge anything into your working tree, you must decide what to do now.

A git merge origin/master will merge in the remote origin server branch of master to your working directory.

If you want to merge directly to your working tree use git-pull, from the man page:

More precisely, git pull runs git fetch with the given parameters and calls git merge to merge the retrieved branch heads into the current branch. With --rebase, it runs git rebase instead of git merge.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top