• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

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 ?
 
Bartender
Posts: 15737
368
  • 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:
 
Destiny's powerful hand has made the bed of my future. And this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic