• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • 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: 14010
315
  • 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:
reply
    Bookmark Topic Watch Topic
  • New Topic