i want to edit the .git folder inside the selected repo and i also want to push it to remote.
is it possible to do , if so plz help me to solve the issue.
Thanks & Regards
Balazs is right, you cannot automatically install client-side hooks for all users this way. But you may consider server-side hooks, especially update and pre-receive. See this documentation: http://git-scm.com/book/es/v2/Customizing-Git-Git-Hooks
The downside is that your users might only realize that many of their commit messages are invalid when they try to push, and cleaning up dozens of messages might be a tedious task.
I recommend you to use a server-side (update or pre-receive) hook and an optional client-side pre-commit hook. Your users will happily install the client hook themselves manually if they want their lives become easier
Update: Our company (Midori) has released a JIRA plugin called Commit Policy Plugin for JIRA that makes managing centralized source code policies a breeze and it can help in the situation being discussed in this topic.
It allows you to build complex commit rules on the JIRA server via a nice UI and it also allows you to generate ready-to-use hook scripts utilizing these policies for Git (and also currently Mercurial and SVN) in a few mouse clicks. You can simply drop the generated hook script package into your Git central repo and start using it.
I recommend you to give it a try, it will save you a lot of work - I know it, I put that work into the code
You cannot put hooks inside the .git folder in such a way that they will apply to everybody who clones the repo, since the .git folder is not under source control. You can create a folder in your repo where you store your hooks and ask everybody to copy the contents inside the .git folder locally.
(Or install the hooks on the server only, so non-conforming pushes are rejected.)
but i want to apply that hooks to all users, i have build some script for commit message , so i need everyone to use it. pl tell me from where that .git file comes, means in server where shall i change the .git folder so that it will be permanent in the every users .git folder.
You could create a .sh file (init-repo.sh) and tell new collaborators to run this script after they cloned the repo. Take a look at this: https://github.com/angular/angular.js/blob/master/init-repo.sh In the last line: echo "Installing git hooks..." ln -sf ../../validate-commit-msg.js .git/hooks/commit-msg
Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot