I paste the HTTP but it doesn't work.
$ git clone https://github.com/Msajjad313/coursera-test1.git
Cloning into ‘coursera-testi’...
Fatal: unable to access 'https://github.com/Msajjad313/coursera-test1.git/': Could not resolve host: github.com
I paste the HTTP but it doesn't work.
$ git clone https://github.com/Msajjad313/coursera-test1.git
Cloning into ‘coursera-testi’...
Fatal: unable to access 'https://github.com/Msajjad313/coursera-test1.git/': Could not resolve host: github.com
What you're trying to access might not be public, so if its accessible from your git account, you will have to log in to your git account though the terminal.
First: git config --global user.name "your_username"
Then: git config --global user.email "your_email_address@example.com"
You can follow the process and read more about it HERE
Could not resolve host: github.com
Means you have a DNS or Firewall problem.
Try from a command line:
ping github.com
There is nothing wrong with the repo, I can clone it without problem.
If you are running WSL Ubuntu and facing such kind of issues, follow the Steps below:
Step 1. Inside WSL2, create or append file: /etc/wsl.conf
Step 2. Put the following lines in the above .conf file in order to ensure the your DNS changes do not get blown away
sudo tee /etc/wsl.conf << EOF
[network]
generateResolvConf = false
EOF
Step 3. In a cmd
window (!!), run wsl --shutdown
Step 4. Start WSL2
Step 5. Run the following inside WSL2 (line with search is optional)
sudo rm -rf /etc/resolv.conf
sudo tee /etc/resolv.conf << EOF
search yourbase.domain.local
nameserver 8.8.8.8
nameserver 1.1.1.1
EOF
For source of the original answer, you can proceed to the following link in askubuntu.com ->
Refer the Answer by @matson kepson
Thank me later.