Home > Software engineering >  How to update git for sources you've been working on since Clone?
How to update git for sources you've been working on since Clone?

Time:11-17

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?

CodePudding user response:

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
  •  Tags:  
  • git
  • Related