i am unable to clone a repository or push or pull a code.if i am try to execute those commands, terminal not responding at all,continuously running. but git add,commit commands working. i have upgrade the git version to 2.29.
Asked
Active
Viewed 645 times
1
-
This is most likely a network issue on your local machine where it is not able to reach the remote repository. Git’s `add` and `commit` commands do not need to access network and work locally on your machine. This is why these commands are working. However, the other commands which require communicating with the remote repository (like, pull, clone etc.) need to access network. – Maverick Feb 08 '21 at 15:44
-
any solution for this sir? – thssviki Feb 08 '21 at 15:45
-
You should try to run the commands with verbose output. See this (https://stackoverflow.com/questions/7319357/does-git-add-have-a-verbose-switch). – Maverick Feb 08 '21 at 15:47
-
nothing happens sir – thssviki Feb 09 '21 at 01:19
-
Did you add your public SSH key to github? – Prihex Feb 09 '21 at 10:10
3 Answers
1
First, Git 2.29 is not the latest one: 2.30 (or in a few hours, 2.30.1) is.
Second, you can try and check if an HTTPS URL would work:
cd /path/to/my/repo
git remote set-url origin https://<user>@github.com/<user>/<repo>
You will need to enter your GitHub username and password.
If this works, that means the SSH protocol might not be allowed in your environment (which is generally the case for outgoing streams in a corporate setting)

VonC
- 1,262,500
- 529
- 4,410
- 5,250
0
Host bitbucket.org
Hostname altssh.bitbucket.org
IdentityFile ~/.ssh/id_rsa.pub
Port 443
AddressFamily inet
added these lines in ssh_config file resolved the issue

thssviki
- 21
- 5
0
Open the gitRootDirecory/.git/config and update url from ssh to https.
[remote "origin"]
url = ssh://xxx.xxx.xxx
to
[remote "origin"]
url = https://git.url.xx

Hemant Shori
- 2,463
- 1
- 22
- 20