-
Notifications
You must be signed in to change notification settings - Fork 109
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
fix: make git commands work #244
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When did the -a
stopped working for needing to do the add
first? In any case, I prefer that way and though this will be done, let's fix the rest to remove the -a
from all the commits
😁
ch00git/05Collaboration.ipynb.py
Outdated
@@ -354,7 +359,7 @@ | |||
# Now commit the merged result: | |||
|
|||
# %% jupyter={"outputs_hidden": false} language="bash" | |||
# git commit -a --no-edit # I added a No-edit for this non-interactive session. You can edit the commit if you like. | |||
# git commit -a --amend --no-edit # I added a No-edit for this non-interactive session. You can edit the commit if you like. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need the amend
here? Shouldn't need to, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll either need amend or provide a commit message. I thought omitting the commit message was intentional. I usually commit my conflict resolves with "Resolve conflict" message; maybe I should do that here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But git provides a default git message when creating a merge commit. Has git changed the default of merges that may not be trying a merge commit but something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC, that is the case only when there are no conflicts. I might be wrong here, but I think the default message is provided when the merge is possible without conflicts (and there is no fast forwarding). Is this the case or was it different at the time of writing the course?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my new installed laptop without any configuration beyond author name it does create the message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see. I had no idea this was possible, thanks! The command in the course is failing because it is not generating conflicts at all. Would it be possible to add ➕ me to https://github.com/UCL/github-example as well? It is a bit hard to work on the git pages locally, given that all push/pull commands fail because of access issues 😨
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've got access now... but I don't think you need it. Without looking into it in detail, I wonder if the problem is produce because git
now requires setting the default action when pulling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git can really make you scratch your head sometimes. Turns out, the github-example repository had a legacy master branch (which was set as default), so whenever the lesson cloned the repo, it automatically used the master branch. But the lessons where we create a git repo locally, git uses the main branch. The conflicts did not show up because the commits were on 2 different branches.
Everything looks good now! 🫠
f37c5e2
to
a471e94
Compare
This is confusing to me as well. For some reason, git is considering |
Co-authored-by: David Pérez-Suárez <d.perez-suarez@ucl.ac.uk>
3c34915
to
614c32c
Compare
b8ccc24
to
4b12a2c
Compare
…nto saransh/git-commands
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing!
Closes #243