Closed ZZhangchen closed 5 years ago
I have 1 point to ask you to modify now.
You see a message "This branch has conficts that must be resolved.". Because the branch you branched out is not on the current latest master branch.
Run below command to see your branch's commits history.
$ git log
The head is newer commit. On the current master branch, the latest commit is below.
commit 9f5bd109db98ee99e15478cf9df5204d1f91871f
Author: Jun Aruga <happy@oh4u.net>
Date: Mon May 13 22:11:23 2019 +0200
Update docs to install and start docker on Ubuntu.
But maybe you see below commit before your 2 new commits.
commit 4d5226f5d447273c22ca518bd18f2fcafff5207a
Author: Jun Aruga <happy@oh4u.net>
Date: Sun May 12 21:26:25 2019 +0200
Update repo URL to HTTPS, that is easier to do "git clone ...".
You can see it from GitHub page too. https://github.com/ZZhangchen/yamp-arm/commits/feature/update-doc-windows
So, how to fix this.
Maybe you are at feature/update-doc-windows
branch.
$ git branch
* feature/update-doc-windows
master
Rename current branch feature/update-doc-windows
to feature/update-doc-windows-bak
$ git branch -m feature/update-doc-windows-bak
$ git branch
* feature/update-doc-windows-bak
master
Move to master
branch at once.
$ git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
$ git branch
feature/update-doc-windows-bak
* master
Check the branch's commits history. You see the old commit is in the head of the commits.
$ git log
Then run below command to pull your local's master branch to latest status.
$ git pull
Check the branch's commits history. You see the new commit is in the head of the commits.
$ git log
Then create new branch from master branch again.
$ git branch
feature/update-doc-windows-bak
* master
$ git checkout -b feature/update-doc-windows
Now you are at feature/update-doc-windows again.
$ git branch
* feature/update-doc-windows
feature/update-doc-windows-bak
master
Next is to copy your new 2 commits to your the new branch.
git cherry-pick
command is to do it.
Seeing https://github.com/ZZhangchen/yamp-arm/commits/feature/update-doc-windows ,
you can check the commit hashes (7 hexadecimal digits) that is first 7 digits (shorten version) from full commit hash.
$ git cherry-pick 0a6cc5bb17228bbd1537a995c1b81ff2cf6b6d0a
$ git cherry-pick 93ff29b1ffe6fee06d75e63ffd473b2d6f22e996
Then update your remote repository (ZZhangchen)'s feature/update-doc-windows
forcely (-f
option).
$ git push ZZhangchen feature/update-doc-windows -f
This PR is updated without conflict message.
Hi Jun,
Running into some problem:
Cherry-pick fail:
0a6cc5bb17228bbd1537a995c1b81ff2cf6b6d0a
error: could not apply 0a6cc5b... Add the link to the method of setting up
docker for windows and WSL
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'```
So I used `git commit -m` instead
git push fail:
feature/update-doc-windows, -f
error: src refspec feature/update-doc-windows, does not match any.
error: failed to push some refs to 'https://github.com/ZZhangchen/yamp-arm'
chen@GBRLAP-CZ2:~/yamp-arm$ git push ZZhangchen feature/update-doc-windows
Username for 'https://github.com': zzhangchen
Password for 'https://zzhangchen@github.com':
To https://github.com/ZZhangchen/yamp-arm
! [rejected] feature/update-doc-windows ->
feature/update-doc-windows (non-fast-forward)
error: failed to push some refs to 'https://github.com/ZZhangchen/yamp-arm'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for
details.```
On Sat, May 18, 2019 at 10:27 PM Jun Aruga notifications@github.com wrote:
I have 1 point to ask you to modify now.
You see a message "This branch has conficts that must be resolved.". Because the branch you branched out is not on the current latest master branch.
Run below command to see your branch's commits history.
$ git log
The head is newer commit. On the current master branch, the latest commit is below.
commit 9f5bd109db98ee99e15478cf9df5204d1f91871f Author: Jun Aruga happy@oh4u.net Date: Mon May 13 22:11:23 2019 +0200
Update docs to install and start docker on Ubuntu.
But maybe you see below commit before your 2 new commits.
commit 4d5226f5d447273c22ca518bd18f2fcafff5207a Author: Jun Aruga happy@oh4u.net Date: Sun May 12 21:26:25 2019 +0200
Update repo URL to HTTPS, that is easier to do "git clone ...".
You can see it from GitHub page too. https://github.com/ZZhangchen/yamp-arm/commits/feature/update-doc-windows
So, how to fix this.
Maybe you are at feature/update-doc-windows branch.
$ git branch
- feature/update-doc-windows master
Rename current branch feature/update-doc-windows to feature/update-doc-windows-bak
$ git branch -m feature/update-doc-windows-bak
$ git branch
- feature/update-doc-windows-bak master
Move to master branch at once.
$ git checkout master Switched to branch 'master' Your branch is up-to-date with 'origin/master'.
$ git branch feature/update-doc-windows-bak
- master
Check the branch's commits history. You see the old commit is in the head of the commits.
$ git log
Then run below command to pull your local's master branch to latest status.
$ git pull
Check the branch's commits history. You see the new commit is in the head of the commits.
$ git log
Then create new branch from master branch again.
$ git branch feature/update-doc-windows-bak
- master
$ git checkout -b feature/update-doc-windows
Now you are at feature/update-doc-windows again.
$ git branch
- feature/update-doc-windows feature/update-doc-windows-bak master
Next is to copy your new 2 commits to your the new branch. git cherry-pick command is to do it. Seeing https://github.com/ZZhangchen/yamp-arm/commits/feature/update-doc-windows , you can check the commit hashes (7 hexadecimal digits) that is first 7 digits (shorten version) from full commit hash.
[image: chen-commits] https://user-images.githubusercontent.com/121989/57974614-6ca35700-79bb-11e9-8768-032c131654e2.png
$ git cherry-pick 0a6cc5bb17228bbd1537a995c1b81ff2cf6b6d0a $ git cherry-pick 93ff29b1ffe6fee06d75e63ffd473b2d6f22e996
Then update your remote repository (ZZhangchen)'s feature/update-doc-windows forcely (-f option).
$ git push ZZhangchen feature/update-doc-windows -f
This PR is updated without conflict message.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/team-gogut/yamp-arm/pull/19?email_source=notifications&email_token=AEIAB3CVS2IJU2ZSCW44UD3PWBRDLA5CNFSM4HN27GL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVWVN3I#issuecomment-493704941, or mute the thread https://github.com/notifications/unsubscribe-auth/AEIAB3BEOIASYZUOCCS35ILPWBRDLANCNFSM4HN27GLQ .
@ZZhangchen when you reply with code, I prefer you use not reply from email, but write message from GitHub page. You can see how your message is displayed in the page like this. The message does not show your writing code ("...
") correctly. The code you wrote is not shown as gray background color.
https://github.com/team-gogut/yamp-arm/pull/19#issuecomment-493706949
As you failed git cherry-pick ...
. That means the cherry-picked commit has conflict part for the current master branch. And in the case, you have to fix the conflict by your editor.
$ git cherry-pick 0a6cc5bb17228bbd1537a995c1b81ff2cf6b6d0a
=> failed message
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
You are currently cherry-picking commit 0a6cc5b.
(fix conflicts and run "git cherry-pick --continue")
(use "git cherry-pick --abort" to cancel the cherry-pick operation)
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: docs/development.md
Open docs/development.md
with your editor. In below case, I use vi
.
$ vi docs/development.md
You see below part in the file. That part is the one you have to edit to fix the conflict.
<<<<<<< HEAD
* Windows: I am not sure.
* Linux(Ubuntu): `$ sudo systemctl start docker` or `$ sudo service docker start`
=======
* Windows (WSL): See https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-wsl-to-work-flawlessly-
>>>>>>> 0a6cc5b... Add the link to the method of setting up docker for windows and WSL
That part can be replaced like this.
* Windows (WSL): See https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-wsl-to-work-flawlessly-
* Linux(Ubuntu): `$ sudo systemctl start docker` or `$ sudo service docker start`
$ git add docs/development.md
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
You are currently cherry-picking commit 0a6cc5b.
(all conflicts fixed: run "git cherry-pick --continue")
(use "git cherry-pick --abort" to cancel the cherry-pick operation)
Changes to be committed:
modified: docs/development.md
$ git commit
The editor (vi
) is opened with below message.
Type Esc
+ :wq
.
Add the link to the method of setting up docker for windows and WSL
# Conflicts:
#>--docs/development.md
#
# It looks like you may be committing a cherry-pick.
# If this is not correct, please remove the file
#>--.git/CHERRY_PICK_HEAD
# and try again.
Now you see your 1st commit is merged.
$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
Untracked files:
(use "git add <file>..." to include in what will be committed)
$ git log
commit 91c3449778ebc9d1f335073699a655553241ebb9
Author: ZZhangchen <zhangchen1983@gmail.com>
Date: Sat May 18 21:46:12 2019 +0200
Add the link to the method of setting up docker for windows and WSL
commit 9f5bd109db98ee99e15478cf9df5204d1f91871f
Author: Jun Aruga <happy@oh4u.net>
Date: Mon May 13 22:11:23 2019 +0200
Update docs to install and start docker on Ubuntu.
...
Then do 2nd cherry-pick
$ git cherry-pick 93ff29b1ffe6fee06d75e63ffd473b2d6f22e996
=> failed
Open the file and fix the conflict part.
$ vi docs/development.md
...
<<<<<<< HEAD
* Windows (WSL): See https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-wsl-to-work-flawlessly-
* Linux(Ubuntu): `$ sudo systemctl start docker` or `$ sudo service docker start`
=======
* Windows: windows key > Docker Desktop
* Windows subsystem for Linux (WSL): See https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-wsl-to-work-flawlessly-
>>>>>>> 93ff29b... Change the wording of Run docker daemon on windows and WSL
...
Then after fixing (editing),
$ git add doc/development.md
$ git commit
Check your 2nd commit is also merged.
$ git status
$ git log
So, finally
$ git push ZZhangchen feature/update-doc-windows -f
That's it.
An another way to fix conflict, See https://github.com/team-gogut/yamp-arm/pull/19
You see below part in this page.
This branch has conflicts that must be resolved
Use the web editor or the to resolve conflicts.
Click a link to fix conflict from page. It guides you.
By the way, below part you added has tailing space. (1 space at the end of the line). Remove the space. I recommend you to change a setting to visible your tab and space on you editor.
See https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-wsl-to-work-flawlessly[1 space]
Great! Now it seems you could fix the conflict.
You can check your modification at this page's "File changed" tab or
$ git diff 9f5bd109db98ee99e15478cf9df5204d1f91871f
or
$ git log -p
on your local's feature/update-doc-windows branch.
So, below part 's "()"' in your modification is intended? I guess you tried to add Markdown format's link for that?
https://github.com/ZZhangchen/yamp-arm/blob/feature/update-doc-windows/docs/development.md
See (https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-wsl-to-work-flawlessly).
Memo: This pull-request is to fix https://github.com/team-gogut/yamp-arm/issues/18 .
So, below part 's "()"' in your modification is intended? I guess you tried to add Markdown format's link for that?
Yes, that is what I was trying to do. I will need to learn mark down as well. :)
Now I am switching to ubuntu operating system, hopefully in the future I will have less troubles as in WSL. :)
Should I close the request now?
Yes, that is what I was trying to do. I will need to learn mark down as well. :)
Now I am switching to ubuntu operating system, hopefully in the future I will have less troubles as in WSL. :)
Sure, I am fine for that.
Should I close the request now?
No, I wish that you are going to accomplish this pull-request.
I think this is a necessary process. When we start new things, this can happen. And I wish this pull-request is for your experiences rather than the efficiency of the task.
We do not have to hurry up for this PR. Let's do step by step.
So, now I ask you to implement the markdown link format in this PR adding 3rd commit. :)
Here is the manual. https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#links
[I'm an inline-style link](https://www.google.com)
You can also see the link format is used in other parts of the docs/development.md
.
After you clear it, finally I tell you how to adjust your commits with git rebase -i <commit hash>
.
After that, you are going to learn basic knowledges to send a pull-request in general. :) Next time you can do better than this time. Let's enjoy it!
Thank you Jun. I do enjoy this "learning-by-doing" process. My only concern is that I will trouble you too much. ;) I have some issue with my ubuntu computer last night. I will try to fix it as soon as possible.
My only concern is that I will trouble you too much. ;)
No worry about it. As I said, this is a necessary and inevitable process when we start and launch a new project. This is a real work to move forward a project, and what I wanted to experience.
After finishing this PR, I will write this git operation to our wiki. So, it is useful for other members and new members in the future too.
Our team's advantage and strength are we have quite different backgrounds for each other.
Not many biologists have a good enough git knowledges and experiences. Not many IT software engineers have a good enough biology knowledges and experiences.
But through the experience of the collaboration work, we have the opportunities to do it.
For git's operation, as I have the experience, I can share it. This is just what I can contribute. But for a biology's work and knowledges, obviously I need your help.
I have tried again. Hope this time is alright. :)
Oops. why I closed this pull request? I don't know how I did it.
Yeah, it closed this pull-request. and deleted the remote repository (ZZhangchen/yamp-arm
)'s branch feature/update-doc-windows
too.
But do not worry. you can recover it after your local repository's feature/update-doc-windows
to ZZhangchen/yamp-arm
repository.
Oops. why I closed this pull request? I don't know how I did it.
I do not know too. logs in this page just shows your operations.
I started another pull request. Did I do it right?
I tried to run docker in windows subsystem Linux, how ever setting up docker for WSL is not straight forward. After several attempts, I found one method that helped me to run docker daemon successfully in WSL. The link to the method is added to the development.md.