1

How to update git for sources you've been working on since Clone?

I cloned project A and continued development.
In this state, a lot of commits in project A have accumulated, and I want to reflect all files committed in project A other than the source I worked on in my source code.

What command to run to achieve that?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
ringhiosi
  • 111
  • 6

1 Answers1

2

Use and the global configuration (Git 2.6+):

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

Then a simple git pull is enough:

  • it will stash your work in progress
  • replay your local commits on top of the updated (fetched) upstream branch
  • reapply your stashed work
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250