Answer the question
In order to leave comments, you need to log in
How to work with Git on multiple computers on a single commit?
I have a work and home computer.
Sometimes it happens that at work you are working on a feature/fix and you don’t have time to finish the work to commit. And after work, I would like to finish work on the feature / fix.
But the bottom line is that the unfinished part does not pull on a full-fledged commit. I would not want to make an intermediate commit from a working computer so as not to clog up the history. And at the same time, playing with transferring changes to a USB flash drive and back on a home computer does not look very attractive.
Maybe someone will tell you how to get out of this situation, so to speak, best practices.
Thank you in advance.
Answer the question
In order to leave comments, you need to log in
And after work, I would like to finish work on the feature / fix.
branch per feature approach will help you. You make a brunch, commit at least every line into it, then merge into the main brunch. Bottom line - the main brunch is clean.
commit as much as you want.
then use "git rebase -i the commit number that spawned from" to merge all the commits into one or as many as you need (anything else will be gone).
As I understand it, we are talking about not making an intermediate commit, incl. and in the feature branch.
If you don’t want to commit at all, you will have to somehow move the code yourself - through an external medium or some kind of dropbox.
You should also keep in mind the recommendations to commit often (for example, https://sethrobertson.github.io/GitBestPractices/#...
It might be worth breaking a feature into several commits.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question