• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

GIT : How to save local commits for future

 
Ranch Hand
Posts: 162
1
Android Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
GIVEN :  I am working on Story and I  have already made some local commits. and I cannot push since CRs take long time to review.

NOW : My Manager want me to work on different small story and push it asap.

What I need :  I want to save these local commits somewhere and work for new story to fix issue and push it.
                      After pushing I want my local commits to come back so that I continue my work on original story .

       I want to know your preferred way of doing this ?
 
Saloon Keeper
Posts: 15510
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should create a branch for each of your stories. You should be able to push your branches to the origin server, and Code Review should occur when you create a pull request to merge a branch into the master branch.

If your current code is not yet in a separate branch, then create a new branch for it, switch to the branch you were working on, and perform a hard reset to the commit that you want to base the new story on. Then create a new branch for the new story.

After you're done with your new branch, you can switch back to the old branch:
 
I RELEASE YOU! (for now .... ) Feel free to peruse this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic