Alright, as I am getting the hang of git, I would like to attempt to provide feedback/cherry pick on the easy stuff. The error "can't pull/push from repository" typically happens if the user you are using does not have rights to push to the desired remote git repository. If you are new, this should be your origin.
Check SSH Agent:
- Check Private Key: navigate to your present user's home directory, on linux this is ~/. In this directory check for the folder ~/.ssh. If it exists, you possibly have git setup correctly. Else, if the folder does not exist, find a useful tutorial online to help you setup git on your machine from start to finish.
- Check Public Key: if you actually found a .ssh folder in your home directory, then look at the public and private keys. Log into your git account online, and navigate to your public key, compare that to the file ~/.ssh/id_rsa.pub. If the contents are the same, your machine should be communicating with the remote server without any issues.
Check Remote: you are here because you are certain that git is installed on your machine, and that your present private key has had it's corresponding public key copied into your online git account. But you may be pushing to the wrong location. First check the branch that you are working on, were you pushing the right branch? Type;
git branch
You should see your branches listed with the present branch highlighted or with an asterisk in front of the name. If you wish to be pushing a different branch, check it out and continue. Then, confirm that you have the right url in origin, type;
git remote -v
Use the given output to confirm that you were pushing to the right remote. If not type;
git remote remove <name>
and follow that with
git remote add <name> <url>
this way when you push your code using
git push <name> <branch>
Everything should be pushed accordingly.
If after checking the above steps, you find that you are still locked out. Note, I assumed that you have a working internet connection. I would obviously setup git from scratch - not the same as reinstalling it, just setup it up and make sure you note the user setting up, and the passphrase that you are using. You should be fine.
Example URL: [email protected]:username/repository_name.git