When I am pushing to remote Git repo, the push was rejected because…

Git’ pre-push hook can be configured in repo by repo.

gitlab-org/gitlab repo introduced it with Lefthook gem.

Due to Ruby packages (via Rubygems), I need to update all the packages corresponding Gemfile/Gemfile.lock on HEAD after:

$ git checkout m…


This content originally appeared on DEV Community and was authored by T "@tnir" N

Git' pre-push hook can be configured in repo by repo.

gitlab-org/gitlab repo introduced it with Lefthook gem.

Due to Ruby packages (via Rubygems), I need to update all the packages corresponding Gemfile/Gemfile.lock on HEAD after:

$ git checkout master (or main) && git pull

While I just wanted to modify some Markdown, why need to update all Ruby packages?

Here is the trouble I had this morning when just docs are to be updated, which demotivate me for a while:

$ git push origin HEAD
Lefthook v0.7.5
RUNNING HOOKS GROUP: pre-push

eslint (SKIP. NO FILES FOR INSPECTION)

graphql_docs (SKIP. NO FILES FOR INSPECTION)

  EXECUTE > docs-metadata
Documentation metadata found in 1 documentation files.


docs-deprecations (SKIP. NO FILES FOR INSPECTION)

haml-lint (SKIP. NO FILES FOR INSPECTION)

docs-removals (SKIP. NO FILES FOR INSPECTION)

  EXECUTE > vale
✔ 0 errors, 0 warnings and 0 suggestions in 1 file.


  EXECUTE > markdownlint
yarn run v1.22.17
$ markdownlint --config .markdownlint.yml doc/install/requirements.md
Done in 0.38s.


stylelint (SKIP. NO FILES FOR INSPECTION)

prettier (SKIP. NO FILES FOR INSPECTION)

rubocop (SKIP. NO FILES FOR INSPECTION)

gettext (SKIP BY SETTINGS)

  EXECUTE > danger
 Could not find omniauth-alicloud-1.0.1 in any of the sources
Run `bundle install` to install missing gems.


SUMMARY: (done in 2.59 seconds)
✔️  docs-metadata
✔️  vale
✔️  markdownlint
🥊  danger
error: failed to push some refs to 'https://gitlab.com/gitlab-org/gitlab.git'

For long time, it has been that independency from Ruby looks better to me in these cases (for Git hooks).

GitLab

Life is too short for me to understand why it is.


This content originally appeared on DEV Community and was authored by T "@tnir" N


Print Share Comment Cite Upload Translate Updates
APA

T "@tnir" N | Sciencx (2022-04-15T02:54:20+00:00) When I am pushing to remote Git repo, the push was rejected because…. Retrieved from https://www.scien.cx/2022/04/15/when-i-am-pushing-to-remote-git-repo-the-push-was-rejected-because/

MLA
" » When I am pushing to remote Git repo, the push was rejected because…." T "@tnir" N | Sciencx - Friday April 15, 2022, https://www.scien.cx/2022/04/15/when-i-am-pushing-to-remote-git-repo-the-push-was-rejected-because/
HARVARD
T "@tnir" N | Sciencx Friday April 15, 2022 » When I am pushing to remote Git repo, the push was rejected because…., viewed ,<https://www.scien.cx/2022/04/15/when-i-am-pushing-to-remote-git-repo-the-push-was-rejected-because/>
VANCOUVER
T "@tnir" N | Sciencx - » When I am pushing to remote Git repo, the push was rejected because…. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/04/15/when-i-am-pushing-to-remote-git-repo-the-push-was-rejected-because/
CHICAGO
" » When I am pushing to remote Git repo, the push was rejected because…." T "@tnir" N | Sciencx - Accessed . https://www.scien.cx/2022/04/15/when-i-am-pushing-to-remote-git-repo-the-push-was-rejected-because/
IEEE
" » When I am pushing to remote Git repo, the push was rejected because…." T "@tnir" N | Sciencx [Online]. Available: https://www.scien.cx/2022/04/15/when-i-am-pushing-to-remote-git-repo-the-push-was-rejected-because/. [Accessed: ]
rf:citation
» When I am pushing to remote Git repo, the push was rejected because… | T "@tnir" N | Sciencx | https://www.scien.cx/2022/04/15/when-i-am-pushing-to-remote-git-repo-the-push-was-rejected-because/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.