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

[QUESTION] How to merge your changes to my fork please? #55

Open
thednp opened this issue Aug 6, 2018 · 4 comments
Open

[QUESTION] How to merge your changes to my fork please? #55

thednp opened this issue Aug 6, 2018 · 4 comments

Comments

@thednp
Copy link

thednp commented Aug 6, 2018

I am preparing this major batch of improvements and wanna know how to merge your changes into my repository since I forked:

  • do I apply your changed manually into mine?
  • or is there an option in the repository settings?

Thanks

@thednp
Copy link
Author

thednp commented Aug 6, 2018

@ViorelEremia @alexluncashu please reply.

@ViorelEremia
Copy link
Contributor

I think there are a few ways to do it.
First Method.

  1. Add a remote upstrem with the url to the original repository:
    git remote add original_repo [email protected]:ThemeFuse/Unyson-Forms-Extension.git
    If you will run git remote -v you must see something like that:
origin  https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)
origin  https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)
original_repo  original_repo [email protected]:ThemeFuse/Unyson-Forms-Extension.git (fetch)
original_repo  original_repo [email protected]:ThemeFuse/Unyson-Forms-Extension.git (push)
  1. Now you must check if you have some new commits in the original repository run:
    git fetch original_repo the result will be poored into a new branch see the example below:
# Some info about objects counts and compresing etc, etc.
Unpacking objects: 100% (90/30), done.
From [email protected]:ThemeFuse/Unyson-Forms-Extension.git
 * [new branch]      master     -> original_repo/master
  1. Now everything from our repository are in a new branch original_repo/master further you can merge this branch in your master git checkout master && git merge original_repo/master
    That will add our commits to your repository so I think you can't create a pull request to us.

Second method(better).
You must move all your commits to a new branch. Lets say your commits are on branch master. Now you must create a new branch from master branch git checkout -b improved-contact-form-items now you have all your commits on this branch.
Further you must checkout to the master and move the pointer of the master to the last our commit
git checkout master and git reset --hard HEAD~CountsOfCommitsTillOurCommits or you can use instead of HEAD~CountsOfCommitsTillOurCommits the hash of our last our commit from your repository(the first commit before your first commit in the master branch). Now you master is clean and on your new branch you have your commits further you can change your remote origin(or you can use the first method to add a new upstream) git remote set-url origin [email protected]:ThemeFuse/Unyson-Forms-Extension.git and pull our changes git pull origin now you have the updated repository and you can manipulate your committies as you like you can merge them into the master or you can merge the master into the your branch to keep the master clean.

@thednp
Copy link
Author

thednp commented Aug 7, 2018

Thank you man.

@thednp
Copy link
Author

thednp commented Dec 12, 2018

@ViorelEremia I'm working on this and scratching my head around, I'm getting alot of errors doing these git commands; I came along to thinking I might not need to merge your 4 commits into my fork.

Is there a problem with merging this fork of mine (short of your 4 commits) with your master later? Currently and recently got some time to come back to it and finish updating my fork with all improvements and work I've done offline.

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

No branches or pull requests

2 participants