Instructions for properly using git to do local development?

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

Post Reply
rrozema
Posts: 470
Joined: Thursday 26 October 2017 13:37
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Delft
Contact:

Instructions for properly using git to do local development?

Post by rrozema »

Hi domoticz developers,

I am totally new to working with git and would like some tips from you on setting up my local (development) environment correctly. I have managed to successfully pull all sources for domoticz and openzwave. I have also succeeded to compile both projects into a working executable( and dll), ready to run. However, whenever I want to get the latest changes from github into my environment, I find that I often need to discard my changes first before I can merge other developers' changes into my local copy. I must be doing something wrong due to my lack of knowledge of git. I have been reading through many git howto's and help pages, but there is so much information in it that my head just spins; I don't understand the simple basics...

So far I've only mostly used "git pull" and the github desktop. I think I need to make local repositories for both projects that hold the sources as they are in the both github projects, then create branches off of each that I need to do my work on. Can someone please give me the git commands to use to accomplish this? As I think I understand it, i should be able to do another "git pull" to merge any new changes from github into my local copy then. But what commands should I use to merge those changes into my working branch then? Because I suspect I'll have exactly the same problem then like with merging from github directly...

My main platform for running Domoticz is a RPI 3B with a z-way razberry shield installed. I can build both domoticz and openzwave from sources to a working setup in that. Because I want to be able to debug, I have also setup a windows machine with Visual Studio 2019 and bought an additional z-wave controller aeotec z-stick. I can also build both the domoticz.exe and openzwaved.dll and run them in the debugger. I would like to receive the git commands to initially set up a local repository and update this from github, plus how to set up a development branch and update this, for both my "production" environment in raspbian plus for my "development" environment in windows.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Instructions for properly using git to do local development?

Post by waaren »

rrozema wrote: Sunday 17 November 2019 8:48 So far I've only mostly used "git pull" and the github desktop. I think I need to make local repositories for both projects that hold the sources as they are in the both github projects, then create branches off of each that I need to do my work on. Can someone please give me the git commands to use to accomplish this? As I think I understand it, i should be able to do another "git pull" to merge any new changes from github into my local copy then. But what commands should I use to merge those changes into my working branch then? Because I suspect I'll have exactly the same problem then like with merging from github directly...
I also have a lack of confidence in my git knowledge and I am worried that I mess-up important stuff when working with branches, so I have my own
'simplified' approach for local development on raspberry

on https://github.com/domoticz/domoticz : " Fork your own copy of domoticz/domoticz to your account"
on local raspberry development system: git clone https://github.com/<your account>domoticz.git <development dir>
make changes and test them
to update the local environment with new commits made on github.com/domoticz/domoticz
git pull https://github.com/domoticz/domoticz.git development
test changes again
commit changes to fork
git add <files you modified>
git commit
git push

on https://github.com/domoticz/domoticz
pull request
new pull request
compare across forks
Choose a Head Repository
<your account>domoticz
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest