I recently uninstalled pre-commit from my environment. I performed the following in pipenv:
pipenv --rm
<deleted Pipfile and Pipfile.lock>
pipenv install -r requirements.txt
I ensured that the pre-commit module was no longer in the requirements.txt. When I make a git commit I get:
~/my_project/.venv/bin/python: No module named pre_commit
This is preventing me from committing, and I have no idea where this is coming from, since pre-commit is not being installed. Further, the traceback path specified is pointing to python and not python3. What am I missing?
typically the way to remove the hook installed by pre-commit install is to call pre-commit uninstall -- though if you've removed pre-commit from your system you can remove the hook scripts manually
you can usually find them by doing:
grep pre-commit.com .git/hooks/*
as that marker is listed in the hook files
from there you can delete them:
grep -l pre-commit.com .git/hooks/* | xargs rm
disclaimer: I made pre-commit
There are still pre-commit hooks installed in your git repository. You can remove them by simply deleting .git/hooks/pre-commit in you repository, after which pre-commit won't be called anymore when commiting.
Related
When trying to clone a repo with git on a Red Hat Enterprise Linux server:
git clone https://github.com/user/repo.git
I receive an error with output:
fatal: Unable to find remote helper for 'https'
I noticed the error when trying to install packages with Vundle for vim. When I looked at the log i found that it was git that was causing the error. The problem is not present when separately running:
sudo git clone https://github.com/user/repo.git
... and running:
/usr/bin/git clone https://github.com/user/repo.git
... also worked fine. Since I run git through vim in this case I want it to work with just the git command.
I have tried to uninstall all the yum-installed git-related packages. I have also tried the approach in this Stackoverflow answer without any results. I have tried to install the latest git from source with this tutorial.
After 2/3 of a work day trying to figure out what was wrong i manually removed every git-related file and directory i could find. Then i simply reinstalled git with
sudo yum install git
Now is everything working fine.
So try doing
find /usr/ -name 'git*' -type d
to find the git-related directories, then remove all these directories. After this you do a new search and pipe that into less to handle the possible large output,
find /usr/ -name 'git*' | less
take note of the exec files and remove them. Mine where in /usr/local/bin. After this you reinstall git with yum like above.
I have run
git init
npm install --save-dev webpack
Then, there is a package.json and a node_modules directory in the root directory.
I want to add the node_modules directory into git repo.
After I run
git add .
There is no response any more. And I found the git.exe process occupy more and more memory usage , but there is not any response after several hours.
What is wrong with it?
Is it caused by pretty much files to be added into repo by git?
How can I debug what happens in detail when that command is executed?
Everything works fine if I just git add some other files/folder which is not node_modules.
Have you git init the repo folder? If yes, then you can run git status. There you should see any new or changed folder.
If node_modules is not mentioned, I guess you have a .gitignore file in your project folder. If you want to git add the node modules folder you will need to remove node_modules/ from .gitignore.
npm install --save-dev webpack will just add one more dependency in package.json and install webpack in your node local repo. This is not a git related command.
Check also this question: Git - Ignore node_modules folder everywhere
Hopfully this will help,
I figured out myself.
This is caused by pretty much symlinks in the node_modules directory. If i evaluated the git-bash as administrator, the new installed node_module symlinks can be created as linux. And then when git add works well. Maybe, if without evaluated git-bash, git-bash can not create symlinks which cause pretty much files need to be git added, even worse maybe a circular reference between symblink and node module staff (not sure), that cause memory consumption of git increase always and no response.
Hope it can help others if met the same problem on windows.
With npm v5 here is now package-lock.json file being created after npm install
It is recommended to commit this file, but I have issue that this file is different for some reason between my dev machine and my server. Even if I push that file to repo, after npm install on server, file changes.
So now I'm attempting to make git untrack this file. After following numerous answers from other questions, I seem to have almost managed to do so, it's not tracked on dev machine, doesn't appear in the repo itself, but after I pull code to server and make npm install, it appears in modified files.
File is in .gitignore, but server git for some reason ignores it.
git check-ignore -v -n package-lock.json
:: package-lock.json
git check-ignore -v -n --no-index package-lock.json
.gitignore:10:package-lock.json package-lock.json
Possibly relevant info:
Dev machine: Windows 10.
Server: Ubuntu 14.04.
I'm pulling code to server using tags.
You need to remove it from your repo (git rm package-lock.json) in order for git to stop tracking it.
.gitignore only works for untracked files. If you have a tracked file that is also in your .gitignore, the fact that the file is tracked overrides the fact that it is also in .gitignore.
Environment: EGit 4.0.1.201506240215-r on Windows 7
I can commit with Git bash and the pre-commit hook is invoked, but when I try to commit in EGit, the pre-commit hook is not invoked.
GIT hooks are nothing but scripts which are to be executed by /bin/sh. Which you cannot do since you are running on Windows OS and you don't have sh.exe.
Install Cygwin
Add the cygwin_root/bin to your PATH
Make sure you install GIT during the cygwin installation(Since git hook scripts will execute git commands)
Hope this will help
I recently set up a new VPS and have installed Git via yum and wget etc. All seemed well - I can add, commit, set up a remote and push to github.
However, when I try to pull from github:
user#domain.com [~]# git pull github master
git: 'pull' is not a git command. See 'git --help'.
Did you mean this?
shell
No, I didn't mean shell, I meant pull!
Now I've googled the heck outta this - including reading several posts on Stackoverflow:
"git pull" broken
git: 'pull' is not a git command. See 'git --help'
Although most posts seem to be about Mac issues (I'm on a CentOS server), it seems to be an issue with the git exec path, which is
user#domain.com [~]# git --exec-path
/usr/local/libexec/git-core
I've tried adding a various things to .bashrc with no success.
The key thing is that when I cd down to /usr/local/ and ls -l, I can't see a libexec directory.
But if I log in as root, I can cd to /usr/local/ and see libexec/, inside which is git-core. I can also git pull as root.
So - I suspect the problem is more to do with permissions and the server setup than git itself.
I've tried
sudo chmod a+rx /usr/local/libexec
But that did nowt too...
When I ssh into another server, as an account user, I can cd down to /usr/local and see libexec - so there's something wrong with this server setup.
Any ideas gratefully received.
Solved it now - the server is using jailshell... Disabling jailshell and using 'normal' shell works a treat