When I do a git pull
, from the git bash, the terminal usually runs the pull, updates my local, and then hangs. I'm not sure if it's waiting for me to do something, but I usually exit out of this with CTRL-C
. After that, I get that an index.lock is preventing me from doing other things to which I have to delete it. Am I misunderstanding how git pull
works?
This might be happening because of some conflict files present in your repository . And you was still trying to check in files . So After that what happen , it will check in your local repository not in master repository . So u was not able to pull or check in anythings in master(head) repository .
If you are starting a new project from a clone, (from the CLI without a fork) when you push to a blank remote you are pushing the entire history of the project you just cloned. This is going to take some time. If you just need the clone as it stands and you don't want the history, delete the .
Pull frequently You should endeavor to keep your local machine as close to the remote repository as possible. The way to do that is to pull all the changes on the remote server to your local copy. You can do this as often as you like, and should do it frequently — at least once a day if not more.
The git pull command is used to fetch and download content from a remote repository and immediately update the local repository to match that content. Merging remote upstream changes into your local repository is a common task in Git-based collaboration work flows.
You may need to remove unnecessary git objects such as dangling commits & blobs
:
git fsck && git gc --prune=now
git-fsck : Verifies the connectivity and validity of the objects in the database
git-gc : Cleanup unnecessary files and optimize the local repository
You can refer here about dangling commits & blobs
.
I am in Windows, and I solved the hang by closing the Visual Studio before doing the pull.
If you are pulling from a linux machine you may want to check this file:
/etc/ssh/ssh_config
To make sure you aren't setting your default SSH port to something other than 22. Some people get confused between that file and:
/etc/ssh/sshd_config
When they're setting up servers to a non-standard SSH port.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With