1

I have a modified file htmlpage.html in my local project directory and i want pull changes for that file from remote branch on bitbucket without effecting my local file changes

1 Answers1

0

Instead of committing or creating a new branch, simply make sure, as I explain here, to have:

git config --global pull.rebase true
git config --global rebase.autoStash true

From there, any git pull will automatically:

  • stash your local changes
  • update your current branch by replaying your local commits on top of the updated (fetched) remote branch (pull --rebase)
  • re-apply your stashed changed to your htmlpage.html

Another approach, I detailed here:

git update-index --skip-worktree -- htmlpage.html
# to cancel it:
git update-index --no-skip-worktree -- htmlpage.html

Save a copy of your file first, before testing a git pull: htmlpage.html snould remain unchanged.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250