有两个分支 # git branch -a * branchA branchB remotes/origin/branchC A分支合并B分支单个文件 注意是本地分支,还是远程分支 # git checkout --patch branchB test.c ... Apply this hunk to index and worktree [y,n,q,a,d,/,K,g,e,?]? 解释 y - 存储这个hunk n - 不存储这个hunk q - 离开,不存储这个hunk和其他hunk a
175down vote It is possible to do (in the deployed repository) git fetch followed by git checkout origin/master -- path/to/file git fetch will download all the recent changes, but it will not put it in your current checked out code (working area). gi