I am getting very annoyed, mainly due to my lack of experience with git.
I have developed a driver for a focuser in indi, but I am fighting git at every turn. I had an hour, and wanted to add a feature, but have just spent the last hour trying to sync my development with the head end, and every time I am told I have a conflict I have t merge. I don't care about the conflict, just replace my fork with the latest master, that should not be difficult! for the life of me I cannot seem to give the correct commands...
here is the end of my command window showing what I am doing, I have tried lots of combinations, but always end up with the same conflict. I just want my fork to be replaced with what ever is in the master, and overwrite any conflicts.
Please could someone please tell me what command sequence I need?
alan@alan-kubuntu:~/indi$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
alan@alan-kubuntu:~/indi$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
alan@alan-kubuntu:~/indi$ git pull
remote: Enumerating objects: 49, done.
remote: Counting objects: 100% (49/49), done.
remote: Total 63 (delta 49), reused 49 (delta 49), pack-reused 14
Unpacking objects: 100% (63/63), done.
From
github.com/ajt68/indi
3ae1993..4e34df7 master -> origin/master
Updating 3ae1993..4e34df7
Fast-forward
CMakeLists.txt | 19 +-
debian/changelog | 6 +
drivers.xml | 6 +-
drivers/focuser/deepskydad_af3.cpp | 907 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
drivers/focuser/deepskydad_af3.h | 147 +++++++++++++
drivers/focuser/focuslynxbase.cpp | 22 +-
drivers/focuser/myfocuserpro2.cpp | 3 +-
indiapi.h | 2 +-
indidriver.c | 58 +++++
indidriver.h | 14 +-
libs/indibase/indidome.cpp | 38 +++-
11 files changed, 1197 insertions(+), 25 deletions(-)
create mode 100755 drivers/focuser/deepskydad_af3.cpp
create mode 100755 drivers/focuser/deepskydad_af3.h
alan@alan-kubuntu:~/indi$ git pull
Already up-to-date.
alan@alan-kubuntu:~/indi$ git remote -v
origin ht..//github.com/ajt68/indi.git (fetch)
origin ht..//github.com/ajt68/indi.git (push)
upstream ht..//github.com/indilib/indi.git (fetch)
upstream ht..//github.com/indilib/indi.git (push)
alan@alan-kubuntu:~/indi$ git fetch upstream
remote: Enumerating objects: 74, done.
remote: Counting objects: 100% (74/74), done.
remote: Compressing objects: 100% (8/
, done.
remote: Total 75 (delta 66), reused 72 (delta 66), pack-reused 1
Unpacking objects: 100% (75/75), done.
From
github.com/indilib/indi
5605ecb..1b6cdde master -> upstream/master
alan@alan-kubuntu:~/indi$ git checkout master
Already on 'master'
Your branch is up-to-date with 'origin/master'.
alan@alan-kubuntu:~/indi$ git merge upstream/master
Auto-merging drivers/focuser/myfocuserpro2.h
Auto-merging drivers/focuser/myfocuserpro2.cpp
CONFLICT (content): Merge conflict in drivers/focuser/myfocuserpro2.cpp
Automatic merge failed; fix conflicts and then commit the result.
alan@alan-kubuntu:~/indi$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
You have unmerged paths.
(fix conflicts and run "git commit")
Changes to be committed:
modified: drivers.xml
modified: drivers/auxiliary/arduino_st4.cpp
modified: drivers/auxiliary/usb_dewpoint.cpp
modified: drivers/dome/baader_dome.cpp
modified: drivers/dome/dome_script.cpp
modified: drivers/dome/roll_off.cpp
modified: drivers/filter_wheel/xagyl_wheel.cpp
modified: drivers/focuser/aaf2.cpp
modified: drivers/focuser/celestron.cpp
modified: drivers/focuser/deepskydad_af1.cpp
modified: drivers/focuser/deepskydad_af2.cpp
modified: drivers/focuser/deepskydad_af3.cpp
modified: drivers/focuser/dmfc.cpp
modified: drivers/focuser/focuslynx.cpp
modified: drivers/focuser/focuslynxbase.cpp
modified: drivers/focuser/lakeside.cpp
modified: drivers/focuser/lakeside.h
modified: drivers/focuser/microtouch.cpp
modified: drivers/focuser/moonlite.cpp
modified: drivers/focuser/moonlite_dro.cpp
modified: drivers/focuser/myfocuserpro2.h
modified: drivers/focuser/nstep.cpp
modified: drivers/focuser/onfocus.cpp
modified: drivers/focuser/robofocus.cpp
modified: drivers/focuser/sestosenso.cpp
modified: drivers/focuser/steeldrive.cpp
modified: drivers/focuser/usbfocusv3.cpp
modified: drivers/rotator/gemini.cpp
modified: drivers/rotator/nightcrawler.cpp
modified: drivers/rotator/pyxis.cpp
modified: drivers/skeleton/mount_driver.cpp
modified: drivers/telescope/celestrongps.cpp
modified: drivers/telescope/dsc.cpp
modified: drivers/telescope/dsc.h
modified: drivers/telescope/lx200_OnStep.cpp
modified: drivers/telescope/pmc8driver.cpp
modified: drivers/telescope/telescope_script.cpp
modified: drivers/telescope/temmadriver.cpp
modified: drivers/video/v4l2driver.cpp
modified: drivers/weather/mbox.cpp
modified: indidriver.h
modified: libs/indibase/connectionplugins/connectionserial.cpp
modified: libs/indibase/indidome.cpp
modified: libs/indibase/indifocuserinterface.h
modified: libs/indibase/indiweather.h
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: drivers/focuser/myfocuserpro2.cpp
alan@alan-kubuntu:~/indi$ rm drivers/focuser/myfocuserpro2.cpp
alan@alan-kubuntu:~/indi$ git merge upstream/master
error: merge is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
alan@alan-kubuntu:~/indi$ git checkout master
drivers/focuser/myfocuserpro2.cpp: needs merge
error: you need to resolve your current index first
alan@alan-kubuntu:~/indi$ git merge upstream/master
error: merge is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
alan@alan-kubuntu:~/indi$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
You have unmerged paths.
(fix conflicts and run "git commit")
Changes to be committed:
modified: drivers.xml
modified: drivers/auxiliary/arduino_st4.cpp
modified: drivers/auxiliary/usb_dewpoint.cpp
modified: drivers/dome/baader_dome.cpp
modified: drivers/dome/dome_script.cpp
modified: drivers/dome/roll_off.cpp
modified: drivers/filter_wheel/xagyl_wheel.cpp
modified: drivers/focuser/aaf2.cpp
modified: drivers/focuser/celestron.cpp
modified: drivers/focuser/deepskydad_af1.cpp
modified: drivers/focuser/deepskydad_af2.cpp
modified: drivers/focuser/deepskydad_af3.cpp
modified: drivers/focuser/dmfc.cpp
modified: drivers/focuser/focuslynx.cpp
modified: drivers/focuser/focuslynxbase.cpp
modified: drivers/focuser/lakeside.cpp
modified: drivers/focuser/lakeside.h
modified: drivers/focuser/microtouch.cpp
modified: drivers/focuser/moonlite.cpp
modified: drivers/focuser/moonlite_dro.cpp
modified: drivers/focuser/myfocuserpro2.h
modified: drivers/focuser/nstep.cpp
modified: drivers/focuser/onfocus.cpp
modified: drivers/focuser/robofocus.cpp
modified: drivers/focuser/sestosenso.cpp
modified: drivers/focuser/steeldrive.cpp
modified: drivers/focuser/usbfocusv3.cpp
modified: drivers/rotator/gemini.cpp
modified: drivers/rotator/nightcrawler.cpp
modified: drivers/rotator/pyxis.cpp
modified: drivers/skeleton/mount_driver.cpp
modified: drivers/telescope/celestrongps.cpp
modified: drivers/telescope/dsc.cpp
modified: drivers/telescope/dsc.h
modified: drivers/telescope/lx200_OnStep.cpp
modified: drivers/telescope/pmc8driver.cpp
modified: drivers/telescope/telescope_script.cpp
modified: drivers/telescope/temmadriver.cpp
modified: drivers/video/v4l2driver.cpp
modified: drivers/weather/mbox.cpp
modified: indidriver.h
modified: libs/indibase/connectionplugins/connectionserial.cpp
modified: libs/indibase/indidome.cpp
modified: libs/indibase/indifocuserinterface.h
modified: libs/indibase/indiweather.h
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: drivers/focuser/myfocuserpro2.cpp
alan@alan-kubuntu:~/indi$ git fetch -all
error: did you mean `--all` (with two dashes ?)
alan@alan-kubuntu:~/indi$ git fetch --all
Fetching origin
Fetching upstream
alan@alan-kubuntu:~/indi$ git reset --hard origin/master
HEAD is now at 4e34df7 Merge branch 'master' into master
alan@alan-kubuntu:~/indi$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
alan@alan-kubuntu:~/indi$ git merge upstream/master
Auto-merging drivers/focuser/myfocuserpro2.h
Auto-merging drivers/focuser/myfocuserpro2.cpp
CONFLICT (content): Merge conflict in drivers/focuser/myfocuserpro2.cpp
Automatic merge failed; fix conflicts and then commit the result.
alan@alan-kubuntu:~/indi$ git reset --hard origin/master
HEAD is now at 4e34df7 Merge branch 'master' into master
alan@alan-kubuntu:~/indi$ git merge upstream/master
Auto-merging drivers/focuser/myfocuserpro2.h
Auto-merging drivers/focuser/myfocuserpro2.cpp
CONFLICT (content): Merge conflict in drivers/focuser/myfocuserpro2.cpp
Automatic merge failed; fix conflicts and then commit the result.
alan@alan-kubuntu:~/indi$ git reset --hard origin/master
HEAD is now at 4e34df7 Merge branch 'master' into master
alan@alan-kubuntu:~/indi$ rm drivers/focuser/myfocuserpro2.cpp
alan@alan-kubuntu:~/indi$ ls drivers/focuser/my*
drivers/focuser/myfocuserpro2.h
alan@alan-kubuntu:~/indi$ git merge upstream/master
Auto-merging drivers/focuser/myfocuserpro2.h
Auto-merging drivers/focuser/myfocuserpro2.cpp
CONFLICT (content): Merge conflict in drivers/focuser/myfocuserpro2.cpp
Automatic merge failed; fix conflicts and then commit the result.
alan@alan-kubuntu:~/indi$ nano drivers/focuser/myfocuserpro2.cpp
alan@alan-kubuntu:~/indi$ git reset --hard HEAD
HEAD is now at 4e34df7 Merge branch 'master' into master
alan@alan-kubuntu:~/indi$ git pull
Already up-to-date.
alan@alan-kubuntu:~/indi$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
alan@alan-kubuntu:~/indi$ git fetch --all
Fetching origin
Fetching upstream
alan@alan-kubuntu:~/indi$ git reset --hard origin/master
HEAD is now at 4e34df7 Merge branch 'master' into master
alan@alan-kubuntu:~/indi$ git merge upstream/master
Auto-merging drivers/focuser/myfocuserpro2.h
Auto-merging drivers/focuser/myfocuserpro2.cpp
CONFLICT (content): Merge conflict in drivers/focuser/myfocuserpro2.cpp
Automatic merge failed; fix conflicts and then commit the result.
alan@alan-kubuntu:~/indi$ git reset --hard origin/master
HEAD is now at 4e34df7 Merge branch 'master' into master
alan@alan-kubuntu:~/indi$ git fetch upstream
alan@alan-kubuntu:~/indi$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
alan@alan-kubuntu:~/indi$ git fetch upstream
alan@alan-kubuntu:~/indi$ git reset --hard origin/master
HEAD is now at 4e34df7 Merge branch 'master' into master
alan@alan-kubuntu:~/indi$ git merge upstream/master
Auto-merging drivers/focuser/myfocuserpro2.h
Auto-merging drivers/focuser/myfocuserpro2.cpp
CONFLICT (content): Merge conflict in drivers/focuser/myfocuserpro2.cpp
Automatic merge failed; fix conflicts and then commit the result.
alan@alan-kubuntu:~/indi$ git pull
error: Pull is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
alan@alan-kubuntu:~/indi$ git fetch upstream
alan@alan-kubuntu:~/indi$ git checkout master
drivers/focuser/myfocuserpro2.cpp: needs merge
error: you need to resolve your current index first
alan@alan-kubuntu:~/indi$ git reset --hard origin/master
HEAD is now at 4e34df7 Merge branch 'master' into master
alan@alan-kubuntu:~/indi$ git checkout master
Already on 'master'
Your branch is up-to-date with 'origin/master'.
alan@alan-kubuntu:~/indi$ git merge -s recursive -X theirs origin/master
Already up-to-date.
alan@alan-kubuntu:~/indi$ git fetch upstream
alan@alan-kubuntu:~/indi$ git merge -s recursive -X theirs origin/master
Already up-to-date.
alan@alan-kubuntu:~/indi$ git merge upstream/master
Auto-merging drivers/focuser/myfocuserpro2.h
Auto-merging drivers/focuser/myfocuserpro2.cpp
CONFLICT (content): Merge conflict in drivers/focuser/myfocuserpro2.cpp
Automatic merge failed; fix conflicts and then commit the result.
alan@alan-kubuntu:~/indi$ git merge -s recursive -X theirs origin/master
error: merge is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
alan@alan-kubuntu:~/indi$ git reset --hard origin/master
HEAD is now at 4e34df7 Merge branch 'master' into master
alan@alan-kubuntu:~/indi$ git merge -s recursive -X theirs origin/master
Already up-to-date.
alan@alan-kubuntu:~/indi$ git clean
fatal: clean.requireForce defaults to true and neither -i, -n, nor -f given; refusing to clean
alan@alan-kubuntu:~/indi$ git fetch origin master
From
github.com/ajt68/indi
* branch master -> FETCH_HEAD
alan@alan-kubuntu:~/indi$ git reset --hard origin/master
HEAD is now at 4e34df7 Merge branch 'master' into master