git-hooks-detect-force-update | Firstly , I describe a syntax of git-rev-list | Frontend Framework library
kandi X-RAY | git-hooks-detect-force-update Summary
kandi X-RAY | git-hooks-detect-force-update Summary
Firstly, I describe a syntax of git-rev-list(1). In this case, we assume within a Git working repository that has this straight history.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of git-hooks-detect-force-update
git-hooks-detect-force-update Key Features
git-hooks-detect-force-update Examples and Code Snippets
Community Discussions
Trending Discussions on git-hooks-detect-force-update
QUESTION
It is possible to deny forced pushes on server-side by setting receive.denyNonFastForwards or by adding a git hook (or in a different way for special GIT servers like Gerrit or Github). I would like to reject a forced update on client side (see also here), when doing a git fetch
or git pull
or a git pull --rebase
. If I don't have access to the GIT server to reject forced pushes (or if I don't trust the server because others have access too), I might want GIT to stop with an error before changing any refs when a forced push was done. This could help to notice attackers changing the remote or if I simple want to know if somebody changes my commits (yes, if I really want to avoid somebody else committing using my name, I need sign my commits using my key).
I seems not to be possible to run code after a fetch or pull command using hooks. I parse the output of git fetch
and raise an error if "forced update" has been printed. But it would actually be better to detect this before refs are changed.
Is there a better way to do this?
...ANSWER
Answered 2019-Mar-05 at 15:31Edit the remote.fetch
line gfrom git config to remove "+" from it, Then non-fastforward fetches would fail. It does not protect though from branch removal
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install git-hooks-detect-force-update
On a UNIX-like operating system, using your system’s package manager is easiest. However, the packaged Ruby version may not be the newest one. There is also an installer for Windows. Managers help you to switch between multiple Ruby versions on your system. Installers can be used to install a specific or multiple Ruby versions. Please refer ruby-lang.org for more information.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page