Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarke gsg changes #6

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Conversation

cstevens
Copy link
Collaborator

@cstevens cstevens commented Mar 12, 2020

NOTE: I created a branch for my fixes and put all the right code in there. This supersedes the changes in this pull request. I'd just like the withdraw it.

There seems to be a conflict in index.md. I don't see it. In any case, I think my version is good. I don't know how to clear it up, so if somebody can let me know, I will take care of it. I think I resolved Wouter's comments as well

@gnash117
Copy link

gnash117 commented Mar 12, 2020

@cstevens are you knowledgeable on resolving merge conflicts with git?

There are two possible ways to resolve this conflict.

checkout the change cstevens:ClarkeGSGChanges locally
merge in iotivity:master into your local copy of cstevens:ClarkeGSGChanges

I don't know what your remote names are

git merge [remote]/master (example git merge origin/master)

in this case the [remote] must be iotivity not cstevens

This should give you a merge conflict. Resolve the merge conflict using a merge tool

git mergetool

most merge tools give you a 3-way merge resolution view. Where you see the remote change, local change, and what the result of the merge will be. Pick the change that you want. Resolve all the merge conflicts then run

git commit merge --continue

push the merge backup to cstevens:ClarkeGSGChanges

The other way is to rebase your local change off iotivity-master

checkout the change cstevens:ClarkeGSGChanges locally

git rebase [remote]/master (where remote is iotivity)

this will apply each commit sequentially till there is a merge conflict.

once again use the mergetool to resolve the conflict then run

git mergetool
git rebase --continue

repeat till the fix with mergetool and then git rebase --continue till the rebase has completed.

You will then need to do a force push to cstevens:ClarkeGSGChanges because rebase changes the commit history.

If you are less comfortable with git the merge option is less likely to cause irreversible errors.

the rebase option will leave you with cleaner looking repository but it does involve re-writing history so has a small possibility to cause irreversible errors.

@gnash117
Copy link

Apparently there are some merge conflict resolution tools available via the web interface

https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/resolving-a-merge-conflict-on-github

let me know if that link helps

@cstevens
Copy link
Collaborator Author

cstevens commented Mar 12, 2020 via email

@gnash117
Copy link

George, While I am knowledgeable on the theory of resolving git conflicts, this is the first time I’ve faced them practically. For some reason, it was recommended that I create a fork to make my changes. In retrospect, I think branch would have been fine. So what I’m considering is to create a branch of iotivity:master, making my changes to that, then doing a pull request on that branch. Does that make sense?

Who ever recomended using a fork was correct in their recommendation. Using forks and making changes on that fork then making a pull request is the correct way to use github.

There is no time like the present to learn about resolving git conflicts. I don't use github much so I can not create a step-by-step guide off the top of my head.

Did the link I shared with you help out?

@gnash117
Copy link

gnash117 commented Mar 13, 2020

Fast attempt at step-by-step instructions:

run

git remote -v

it should show the path for both remotes. Most likely you also have origin which matches one of the two projects depending on your setup.

checkout the branch you are trying to merge:

git checkout -t cstevens/ClarkeGSGChanges

Now you have a choice do you want to merge from iotivity/master or rebase based on iotivity/master

option 1: (recommended for developers less experienced with resolving conflict.)

  • merge from master:

    git merge iotivity/master
    git status

This will show a list of files that were change on both master and your local copy.

open the file(s) in question in an editor:
(You could try git mergetool here but if it is not setup right it could just make things harder.)

look for the conflict markers <<<<<<<, =======, >>>>>>>

figure out what text should be kept between the conflict markers. Delete the text that should not be kept including the conflict markers. Save the updated file.

now add the file(s) to the merge

git add [fixed_file(s)]

now complete the merge

git merge --continue

this should bring up a filled in commit dialog

push the fix up
git push cstevens HEAD:ClarkeGSGChanges

option 2:

  • rebase based on master

    git rebase iotivity/master
    git status

This will show a list of files that were change on both master and your local copy.

open the file(s) in question in an editor:
(You could try git mergetool here but if it is not setup right it could just make things harder.)

look for the conflict markers <<<<<<<, =======, >>>>>>>

figure out what text should be kept between the conflict markers. Delete the text that should not be kept including the conflict markers. Save the updated file.

now add the file(s) to the merge

git add [fixed_file(s)]

now complete the merge

git rebase --continue

You may be presented with a new conflict that will need to be resolved
keep running

git status
[fix merge conflicts]
git add [fixed_file(s)]
git rebase --continue till rebase is complted

push the fix up (not the use of -f because rebase rewrites the repository history it requires a force push)
git push -f cstevens HEAD:ClarkeGSGChanges

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants