Friday 15 January 2010

git checkout file from branch ahead of current branch -



git checkout file from branch ahead of current branch -

i've created local git repo, contains 2 branches i.e master , stable using master development branch , has gone 4-5 commits ahead of stable , contains unstaged edits.

the problem bug has come in against stable, i've stashed unstaged edits on master , performed checkout against stable. need file master, travis.yml, can add together stable when commit bug fix.

is there clean way when merge stable master there no conflicts existing travis.yml?

this i've tried no luck ..

rob@laptop:~/git/project$ git status on branch stable branch up-to-date 'origin/stable'. changes not staged commit: (use "git add together <file>..." update committed) (use "git checkout -- <file>..." discard changes in working directory) modified: config/user.properties no changes added commit (use "git add" and/or "git commit -a") rob@laptop:~/git/project$ git checkout master/86e6e26acf .travis.yml error: pathspec 'master/86e6e26acf' did not match file(s) known git. error: pathspec '.travis.yml' did not match file(s) known git.

so after bug prepare expecting "travis.yml" same across master , stable? in case easy way checkout master, re-create contents of travis.yaml temp location, checkout stable replace travis.yaml in stable 1 had saved.

git intelligent plenty identify both files same , not show merge conflicts. infact git store single file both branches. hope helps.

git

No comments:

Post a Comment