Git Product home page Git Product logo

Comments (4)

rohit679 avatar rohit679 commented on July 23, 2024 1

Here, I am adding the steps & code for writing Pre-commit hook, for preventing changes to the credential files.

  • First make the vscode settings for accessing hidden .git files within vscode
  • Go to settings & search for file.exclude then set { "**/.git" : false} & you are good to go
  • Then go inside .git / hooks/pre-commit.sample & comment previous given stuff by selecting all(ctrl+a) and press (ctrl+/).
  • Copy the given code below and paste it into the file.
FILE_MUST_NOT_CHANGE='conf/api_example_conf.py
conf/remote_credentials.py
conf/email_conf.py
conf/ssh_conf.py
conf/testrailenv_conf.py
conf/tesults_conf.py'

if git rev-parse --verify HEAD >/dev/null 2>&1
then
  against=HEAD
else
  # Initial commit: diff against an empty tree object
  against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi

exec 1>&2

if git diff --cached --name-only $against |
   grep --quiet --line-regexp --fixed-strings     ####"$FILE_MUST_NOT_CHANGE"
then
  echo Commit would modify one or more files that should not change.
  exit 1
else
  exit 0
fi
  • Rename the file to pre-commit [remove .sample]
  • Then make that file executable, go the directory where this file stored via Git Bash & run following -
    chmod +x pre-commit

from qxf2-page-object-model.

rohit679 avatar rohit679 commented on July 23, 2024

I would like to work upon this issue, please assign it to me.

from qxf2-page-object-model.

avinash010 avatar avinash010 commented on July 23, 2024

@rohit679 You can create a fork and start working on any issue. Once done please create a PR

from qxf2-page-object-model.

github-actions avatar github-actions commented on July 23, 2024

Stale issue message

from qxf2-page-object-model.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.