git stash - Git - How to get latest fix while working on a new feature? -


i'm using git , i'm new it. have latest code of project, , i'm working on new feature while i'm working on new feature received email of fix need commited not have yet. unfortunately can't 'get latest version' svn (and merge if needed) new feature file seem blocking pull if new feature file not common fix need get. best way both scenario: 1) have no common files modified new file need, scenario 2) have common file modified (i want quick local merge svn)? w

shall stash, pull fix, , continue work on feature? , pop stash when i'm done?

the original poster asks:

shall stash, pull fix, , continue work on feature? , pop stash when i'm done?

that's 1 option have. other options follows:

the original poster asks:

what best way both scenario:

  1. i have no common files modified new file need?
  2. i have common file modified (i want quick local merge svn)?

if new file have ready commit, can commit it, merge or rebase. if file modified modified in commits you're fetching, doesn't matter if merge or rebase, there's chance might have resolve conflicts either way:

git commit -am "commit message here" git fetch <remote-with-fix>  # rebase work on top of fix git rebase <remote-with-fix>/<branch-with-fix>  # or merge instead git merge <remote-with-fix>/<branch-with-fix> 

if new file have not ready commit, make temporary commit, fetch of fix, rebase work on top, undo temporary commit mixed reset:

git commit -am "temporary commit" git fetch <remote-with-fix> git rebase <remote-with-fix>/<branch-with-fix>     git reset head^ 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -