Skip to main content

Best practices for using Git - amend -m --no-edit

The only thing that I'd add is that you should clean up your git commits in your feature branch before creating a PR. This is easily done with git commit --amend  and squashing.
Adding the -m option allows you to pass in a new message from the command line without being prompted to open an editor.
git commit --amend -m "an updated commit message"
# Edit hello.py and main.py git add hello.py git commit
# Realize you forgot to add the changes from main.py 
git add main.py
git commit --amend --no-edit
https://deepsource.io/blog/git-best-practices/
feat: add beta sequence
^--^  ^---------------^
|     |
|     +-> Summary in present tense.
|
+-------> Type: chore, docs, feat, fix, refactor, style, or test.

Comments

  1. We strongly discourage force pushing, since this changes the history of your repository. If you force push, people who have already cloned your repository will have to manually fix their local history. For more information, see "Recovering from upstream rebase" in the Git manual.

    Amending the message of the most recently pushed commit

    Follow the steps above to amend the commit message.
    Use the push --force command to force push over the old commit.
    $ git push --force example-branch

    git commit --amend
    git push --force

    ReplyDelete

Post a Comment

Popular posts from this blog

About GraphQL - Downside

Web caching complexity

File uploading. Since GraphQL doesn’t understand files, a file uploading feature is not included in its specification. You won’t have to deal with this limitation in case of REST, as there you can POST or PUT whatever content you want to.
To allow file uploads in your GraphQL web app, there are several options: using Base64 encoding. But it will make the request larger and expensive to encode/decode.making a separate API endpoint just for this purpose.using a library like Apollo for implementing the GraphQL multipart request specification.uploadFileToS3:combineResolvers( // isAuthenticated, async (parent, args, { models }) => { const { file } = awaitargs const { createReadStream, filename, mimetype, encoding } = awaitfile conststream = createReadStream() constresult = awaituploadFileToS3(filename, stream) returnresult } ),