Closed shivam-51 closed 4 years ago
Nice job :), can you squash your commits to 1 commit using git rebase -i
?
A few links to help you:
After you are done with squashing you can upload the new commit with git push <remote_name> <branch_name> --force-with-lease
Hey @shivam-51, do you need help with the rebase? Your pr is ready, we just need to "transform" those 7 commits into 1
Hi @mstou, I was trying to squash the commits but am stuck somewhere. This is what i get on typing $ git rebase -i HEAD~7 Can you help me out what to do next.
On Fri, 4 Oct 2019 at 22:56, Miltiadis Stouras notifications@github.com wrote:
Hey @shivam-51 https://github.com/shivam-51, do you need help with the rebase? Your pr is ready, we just need to "transform" those 7 commits into 1
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/algoholics-ntua/algorithms/pull/13?email_source=notifications&email_token=ALNZKX2WOLWNIMAGE2OV5JDQM54CTA5CNFSM4I34DUDKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAMK5II#issuecomment-538488481, or mute the thread https://github.com/notifications/unsubscribe-auth/ALNZKX253XANZUFQSY5COHTQM54CTANCNFSM4I34DUDA .
Right now we pushed some commits to master (merged another PR) so you will first have to update your master branch from our repository!
1) Check if you have a remote pointing to our repo ( git remote -v show
)
2) The common case is to have a remote named upstream
pointing to the original repo and a remote named origin
pointing to your forked repo
3) If you dont have the remote pointing to our repo you can add it like this:
git remote add upstream https://github.com/algoholics-ntua/algorithms.git
Or if you are using ssh:
git remote add upstream git@github.com:algoholics-ntua/algorithms.git
4) Switch to master branch: git checkout master
5) Update master from our repo: git pull upstream master
6) Go back to your branch: git checkout first
7) Rebase to add the latest changes in master: git rebase master
8) Now we will squash your commits, git rebase -i HEAD~7
9) You will be prompted to an editor where you can choose what to do with each commit
10) Select pick
for the first commit and squash
for the others
( something like:
pick 38a72f8
squash d02a449
squash 13d0417
....
)
11) Save and exit. By this point i think the rebasing is done
12) Upload your modified history to your branch with: git push --force-with-lease
and you are done :)
And Done!!. Thank you so much @mstou for your help. Can you check once if everything is proper ?
You're welcome @shivam-51 , thanks for contributing :)
Added a new problem Dice Combination on DP easy.