How to keep uncommitted work in a git clone

Chris Jones jonesc at hep.phy.cam.ac.uk
Fri Nov 4 01:54:23 PDT 2016



On 04/11/16 04:18, Sterling Smith wrote:
>
> On Nov 3, 2016, at 7:54PM, Arno Hautala <arno at alum.wpi.edu> wrote:
>
>> On Thu, Nov 3, 2016 at 9:56 PM, Ryan Schmidt <ryandesign at macports.org> wrote:
>>>
>>> Well, I tried that. I git stashed, then made changes to curl and committed them, and later when I tried to git stash pop, my other changes that I had in my git clone were not restored. I have no idea where they are now.
>>
>> There's also another paradigm to adopt which avoids stashing entirely.
>> Just always work in a branch and feel free to commit even if you're in
>> the middle of something. In your case, you're working on something
>> (let's say it's wget), but curl needs to be fixed too. Commit your
>> incomplete changes on the "wget-update" branch, `git checkout -b
>> curl-update master` to create and checkout a curl branch, complete
>> your work there, and then switch back to the "wget-update" branch.
> This is my preference.  I tried stash as well once, and had trouble with it.

I would agree.

You should get out of the habit of working on the master branch. Leave 
that pristine and in sync with GitHub. For each separate project you are 
working out create a branch (from the master) and work on that. When you 
are ready you can then push that branch to GitHub and create a pull 
request for it.

Chris

>
> -Sterling
> _______________________________________________
> macports-dev mailing list
> macports-dev at lists.macosforge.org
> https://lists.macosforge.org/mailman/listinfo/macports-dev
>


More information about the macports-dev mailing list