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

Git Hub Help -- Squashing your Commits #2339

Closed
jschwarzwalder opened this issue Jun 14, 2016 · 4 comments
Closed

Git Hub Help -- Squashing your Commits #2339

jschwarzwalder opened this issue Jun 14, 2016 · 4 comments

Comments

@jschwarzwalder
Copy link
Contributor

https://coala.readthedocs.io/en/latest/Users/Tutorials/Git_Help.html#squashing-your-commits

I"ve learned a few things in the past two days about where people can get stuck when trying to do a pull request.

  1. DON"T HIT UPDATE
    If you get a message that your branch is out of date you need to follow these steps:
    Hi,

it looks like your PR is out of date and needs a rebase. This page may help you to get started on this. (Do not press the update branch button. It's evil.)

Add the original coala repository as a remote:

git remote add upstream https://github.com/coala-analyzer/coala.git
Then go to your branch and rebase it onto our master:

git checkout <yourbranch>
git fetch upstream
git rebase --interactive upstream/master

Now push it up. You will need to do a force push because you change history here (do not do this on master branches :)):

git push --force
Ping us on our gitter channel if you need help!

  1. gitmate will check you line length and space at the end of your line
    Yeah you can't see it but its there, Its an easy fix, but where you can "git" into trouble is if you try to make a quick change and it makes a new commits.

See I was in the docs and I clicked on the friendly Edit on GitHub link in the upper corner. This as a bad idea, because I am not perfect and like the guide says it had errors the first time.

The trick is that you need to git commit -a --amend after you make a change, and its best to make the change locally

  1. You will make a mistake and have multiple commits, but all is not lost

Count how many commits you have and then use this command to merge them into one
git rebase -i HEAD~9 where 9 is the number of commits you need to merge together

A screen will pop up, and the key is to type f or fixup next to all of the commits of the changes you made after your initial pull request.
More information about rebase
See this is important because gitmate checks each commit to see if it is passing. and if you make a new commit to fix the errors it found, it will always stop at the first commit. think of it like a while loop. While the first commit has error it will not move on to the next commit and check it. So you have to squash or fixup the change. This is essentially the same thing as typing git commit -a --amend,so in the future you should probably just do that.

@gitmate-bot
Copy link
Collaborator

Thanks for reporting this issue!

Your aid is required, fellow coalaian. Help us triage and solving this issue!

CC @sils1297, @AbdealiJK

@jschwarzwalder
Copy link
Contributor Author

@sils
Copy link
Member

sils commented Jun 17, 2016

@jschwarzwalder thanks for reporting this and sorry for not coming back to this earlier: I think we'll need to converse about what to do best here, maybe we'll find some time where we can do a VoiP call with you, me, @sims1253 , @Makman2 and possibly others to speak about the contribution process and what options we have to make it simpler.

@Adrianzatreanu
Copy link
Contributor

This issue was moved to coala/documentation#32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants