Another Git question if someone wouldn't mind answering:
I develop websites on a desktop from within the office, and on a laptop when I'm working from home, both storing files on their local drives and tracked using an online Git repository.
When I create a new feature from the laptop at home, what would be be the best way to get these changes over to the desktop - would I stage the changes, create a commit for them and then push them to the online repo even though the feature is still incomplete, or is there a better way?
I'm really not sure if creating a new commit on the feature branch just to push the changes to the repo just so that I can fetch the changes when I'm in the office is the correct way, but perhaps I'm wrong...?
You should be using a new branch any time you are creating a new feature or fixing a bug - which you may already be doing.
I would just commit your changes on the local feature branch and push changes to your remote feature branch and then pull them down on your other machine, there is no problem with this...
If you want to tidy up your commits before you merge them into master then you can squash them ... see this question: Squash my last X commits together using Git
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With