OK, I have very limited experience with Git and very limited patience with it because the errors it provides aren't in plain and simple English. I'm just trying to upload my code to our internal Bitbucket server - plain and simple.
I created a repository in BitBucket and ran the following:
cd existing-project
git init
git add --all
git commit -m "Initial Commit"
git remote add origin https://username@bitbucket.company.org/scm/co/project-0987654321.git
git push -u origin master
The problem is, I realised I got the repository name wrong when creating it within Bitbucket, so I deleted the repository and recreated it with the correct name, and now when running the above on my local machine it says:
"On branch master
Initial commit
nothing to commit"
When I add the Bitbucket origin, it says:
"fatal: remote origin already exists"
And when I run the git push, it says:
"error: src refspec master does not match any
error: failed to push some refs to 'https://username@bitbucket.company.org/scm/co/project-0987654321.git'"
So how can I get it back to a "normal, ready to commit, good to go" state on the local machine? I've obviously butchered something in my inexperience.
EDIT:
"git status" says I'm:
On branch master
No commits yet.
So I run: "git branch --set-upstream-to origin/master" as per git status (nothing to commit, working directory clean), however with changes commited, and I get:
branch 'master' does not exist
It literally makes no sense. I've tried every variation of deleting the local .git repository and the Bitbucket repository and trying from scratch to no avail.
It's almost as if the files are "tainted" and will not upload.
Bring back the days of copy and paste... that's literally all I want to do. I've never known a system like this.