Git Cherry-Pick -


i'm newbie git, , understand how git cherry-pick works, here problem:

recently, in team, changed directory structure in master, not directory structure in branch.

now, when make changes code in branch, want bring them (cherry-pick) master. fine until directory structures in both master , branch same.

topdir/some/subdir/file -- master
topdir/some/other/subdir/file -- branch

file, changes brought master same, not directory structure contained in. when try cherry-pick usual way, error along lines of:

git checkout master git cherry-pick commit error: pathspec topdir/some/other/subdir/file not exist

now, best way go cherry-picking in scenario? pointers highly appreciated.


ok. noticed that, in same scenario, when cherry-pick, git smart enough pick 1 of files correctly commit, not recognize other.

to use same example mentioned in original post: in same commit, topdir/some/subdir/file1, topdir/some/subdir1/file2.

i go master, has "file1" , "file2", in different dir structure: topdir/src/some/subdir/file1 topdir/src/some/subdir1/file2.

now, if cherry-pick, git intelligent enough pick changes in file1, though in different dir structure, doesn't pick changes file2. pointers? if wants me more clear, i'll happy to.

so, did workaround problem cherry-pick, manually change 1 git did not pick up, , "git commit -c .

happy :) if 1 in master permanent way, fix file structure in topic branch match master, commit branch, *then merge changes master, not cherry-pick. in

git checkout branch mv other/subdir/file subdir/file git status // git add , git rm commit proper git commit -m "fixing file struct" git checkout master git merge branch 

really though, depends on use cases of files are, , want in master branch, more company specific question, not technical problem here can answer ;)


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -