The git manuals aren’t really all that bad.) Then, we typed git commit -amend. (If you ever want to know what a git command flag means, type the equivalent of man git-add. You see that we added the edits to git’s staging area, with git add -A. # There's no reason you can't use your usual editor to edit the file. # Do the edits you need to, here, and then type `:wq`. Most maintainers I know would agree with me. Is it important that a maintainer told you to remove a trailing space? I don’t think so. But, more relevantly, they often aren’t that important. Technically, they are saved on GitHub in outdated diffs, if anyone wants to see them, although they won’t be in the git history itself (which makes them less accessible and useful). The only person likely to be touching that branch will be you.Ī lot of people complain that then the comments made by the maintainers will be lost. No one is going to be touching that PR, so you don’t have to worry about dirtying past history. While most git guides tell you that “Force pushing is the worst thing in the world, and it makes you a Sith Lord if you use them, and we will find you and hunt you down”, really, it makes sense in situations where a commit on a non-merged PR should be changed. If you’re using a different naming scheme for origin and upstream, you will need to update that accordingly, of course.) Option 2: Manually add changes, amend, and force push git push origin HEAD is just longhand for pushing to whatever branch you’re currently on. (On a side note: git push is enough if you’re on newer git versions and the remote matches local. A second commit removing a space, added by accident in the previous commit, isn’t really useful for anyone. Some repositories like to have a very clear history, where each commit shows something meaningful that happened. However, for things like spelling edits, line removals, or general small nitpicky things that the maintainers want you to do, having an extra commit may not be the best option. What this does is provide you with a very clear history of what was committed where, and anyone can see this in the PR and in the future history of the project if it is merged in. $ echo 'these are some edits' > your_file.md
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |