You've basically created a commit on the same PR with the changes
rahul24
i didnt intend to do that
Cyna
So here is somthing you can so
first make a new branch using `git checkout -b <branch_name>`
Just to be on the safe side so you dont lose your code incase something goes wrong :)
SothoTalKer
each pull request requires a separate branch
Cyna
them do `git reset --soft HEAD~1` this will uncommit your changes and not delete them
rahul24
ah i see
Cyna
then one good thing is to make sure you are on top of latest comments so you dont face merge conflicts
rahul24
so just to be clear from within the cloned folder i do git checkout -b <branch_name> and then git reset --soft HEAD~1
so then i can do git push origin <branch_name>?
Cyna
do `git pull --rebase origin master` where origin is metabrainz/musicbrainz-server. You can find if its origin or something else using ``git remove -v
Yea
Are you sure there are no merge conflicts rahul24
rahul24
which step do i do rebase after?
ah there seems to be one conflict
Cyna
That's one very frequent issue during gci that many students work on the same code
Are you using vscode ?
which text editor are you using ?
rahul24
vscode
Cyna
So in vscode using the git plugin its easier to work it merge conflicts
*on
rahul24
would i follow the same steps you gave earlier even with the merge conflict?
reosarevok
Oooh, that's a plugin. I was going to say VSCode makes it super easy, but forgot that
!m rishikesh
BrainzBot
You're doing good work, rishikesh!
reosarevok
(re: your tasks :) )
Cyna
Yep congrats
You shouldn't push the code yet first rebase the code from master
metabrainz/musicbrainz-server/master
I've set it up as upstream. What have you set it up as ?
rishikesh
Submitted my 5th metabrainz task for review.
rahul24
from git pull --rebase origin master i get Your index contains uncommitted changes.
error: please commit or stash them.
reosarevok
rahul24: git stash
That will save your current changes, and then you can reapply them with git stash apply :)
Cyna
Yep :)
rahul24
just did the rebase
was the commit supposed to be removed?
Cyna
You can apply your changes using `git stash apply`
rahul24
i still see it on the website
applied stash
Cyna
Now after applying, You'll see a merge conflict
did you see ?
rahul24
i believe the merge conflict was visible to me even before doing thus
*this
reosarevok
It was on the website, but now your code should have it too (a place where it says "HEAD"
)
Cyna
Merge conflict arises from the code you've created, so when you stashed and rebased the code there should be no merge conflicts. when you apply your code using `git stash apply` you will get a merge conflict
reosarevok
That just means basically "someone has changed the file you worked on in the meantime"
So you need to just find where (the bit with the HEAD)
Hmm strange there was a merge conflict before and when you did git stash and git stash apply. The merge conflict was gone 🤔
them you can just do `git push <your_remote_repo> newline` :)
rahul24
hmm i still se it online
alright ill try
Cyna
Create a PR and link it here. I'll have a look
rishikesh: what is your gci id
rahul24
hi, so when im trying to create a pull request
changes from previous task is also being displayed
nevermind i figured it out sorry
Cyna
reosarevok: do recheck the PR when you are free :)
rishikesh
It's Rishikesh
Cyna
my one. I've made temp fix to make things wokr
*work
reosarevok
I'm going on a hike today but I might get to it in the evening. bitmap: if you have time you could look at Cyna's code :)
rahul24
hi Cyna sorry im not sure what went wrong
changes from the previous pull request are showing in the Showing changed files section
BilleeKhoj
reoping
sangeetk joined the channel
reosarevok: prell
CODEin_JDB joined the channel
CODEin_JDB has quit
nav2002__ joined the channel
BrainzGit
[musicbrainz-server] rahulm24 opened pull request #1311 (master…newline): Fix JS on MusicBrainz to have newlines after each call in a method chain where needed https://github.com/metabrainz/musicbrainz-serve...
rahul24
Hi Cyna i fixed it, and submitted a PR, though the conflict still shows up
Thanks reosarevok for helping
ill try to make a commit to fix this
rahul24 has left the channel
rahul24 joined the channel
nav2002__ has quit
BilleeKhoj
(the magical word is prell :o)
reosarevok
rahul24: for the other branch, where you accidentally pushed an extra commit
You should checkout that branch again, then do git reset --hard HEAD^ (if you haven't yet), then force push
rahul24
the confirm/verify ticket?
ill try fixing the original mistake commit
reosarevok
(like a normal push, but with --force at the end of the line - that overwrites what is already on github)
Yes, that one :)
rahul24
i figured out the problem, for the original verify/confirm ticket, i accidentally committed to master and pushed that
reosarevok
To make sure whether the wrong commit got removed, you can use git log
rahul24
would the reset and force push still fix it given that?
reosarevok
That shows you the latest commits
It should, even if your branch is master, I think :)
But try and see
I'm going to be off now, going hiking, but Cyna and or bitmap can help when they're around :)