Git push origin master not working

18.4K    Asked by HannahDyer in Big Data Hadoop , Asked on Jun 24, 2021

Although I could commit my change locally, I can not push to origin master

I run

$ git remote add origin git@github.com:username/test.git

I get

fatal: remote origin already exists.

I run

$ git push -u origin master
I get
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly

What's wrong with this? Why git push origin master not working ?

 



Answered by manish Jhadav

 There are two ways to do this:

1st:-

 git remote set-url

example:-

git remote set-url origin git@github.com:username/test.git

2nd:-

What you need to do is change your 'origin' setting.you edit .git/config in your project root, something like this:

...

[remote "origin"]

url = git://user@dev.foo.com/git/repos/path

fetch = +refs/heads/*:refs/remotes/origin/*

...

or if your 'remote' is actually local:

...

[remote "origin"]

url = /path/to/repos/on/this/machine

fetch = +refs/heads/*:refs/remotes/origin/*

...

If git push origin master not working , all you need to do is edit that file with your favourite editor and change the URL = setting to your new location. Assuming the new repository is correctly set up and you have your URL right, you'll easily be able to push and pull to and from your new remote location.



Your Answer

Answer (1)

Before downloading a file via torrent, you can take several precautions to minimize the risk of downloading malware:


Use Trusted Sources: Stick to reputable torrent websites and communities known for providing verified and legitimate torrents. Avoid lesser-known or suspicious sources.

Read Comments and Reviews: Check the comments and reviews on the torrent page to see if other users have reported any issues with malware or other security concerns.

Use Antivirus Software: Ensure that you have up-to-date antivirus software installed on your device. Many antivirus programs offer real-time scanning of downloaded files, which can help detect and prevent malware infections.

Enable Safe Browsing Features: Some web browsers and antivirus programs offer safe browsing features that can warn you about potentially malicious websites or downloads. Enable these features for an additional layer of protection.

Check File Size and Format: Be cautious of unusually small file sizes or files with non-standard formats, as these could indicate that the file is malicious or corrupted.

Verify Hashes: Some torrent websites provide cryptographic hashes (such as MD5 or SHA-256) for files to verify their integrity. Before downloading a file, you can calculate its hash and compare it to the one provided on the torrent page to ensure that the file has not been tampered with.

Use Online Scanners: There are online services and tools available that allow you to scan files for malware before downloading them. These services typically use multiple antivirus engines to detect threats. Examples include VirusTotal and Jotti's malware scan.

Use a Virtual Machine: Consider downloading files in a virtual machine (VM) environment, especially if you're unsure about their safety. This can help contain any potential malware and prevent it from affecting your main operating system.

Remember that no method is foolproof, so it's essential to remain vigilant and exercise caution when downloading files from the internet, especially from untrusted sources like torrent websites.


6 Months

Interviews

Parent Categories