Hopefully, someone can help me out because I've tried a bunch of things and it appears my system is in some weird state.
The way I am running the system, I am running, essentially, a test environment on my local computer. I do various changes etc locally. I then push to bitbucket, ideally making origin/master the ideal production branch.
The Production server I utilize pulls only from origin. There are no changes made on the production server, so there are no unpushed commits.
The link between my local test environment and the origin works as expected. I'm doing it through GitKraken. I can see the origin/master and local master, and various other branches and they are all where I expect them to be.
The problem is the production server:
When I run "git pull http://.......bitbucket....git master It pulls everything down and acts like it is in the correct commit for origin/master.
However, it says it is 26 commits ahead of origin/master.
I tried running git branch -a
and it shows 1 local branch and 2 remote branches. However, there should be four remote branches, not 2.
Additionally, it seems like I can do anything to pull the correct origin/master location. It always thinks it is at the commit 26 behind.
I have tried git reset --hard origin/master, and that put me to what it thinks is the origin/master, the commit 26 behind where it should be.
My theories as to why this is occurring are as follows:
The commit it is stuck on was the last commit by the previous developer. The repo was set up by this previous dev and his account. My account has admin access to the repo, but I was wondering if there could be a cause here.
There is a git command I'm not using properly that is meant to pull information from the origin.
Any suggestions are appreciated.
Edit: Some clarification on recent comments.
git fetch, git pull, git fetch origin
all provide the following error:
fatal: could not read Password for 'https://djprior@bitbucket.org': No such device or address.
I can only seem to get anything by running:
git pull https://{username}:{password}@bitbucket.org/{account}/{repo}.git master
I was under the impression that if my 'git pull ....' command is working, then it should run a git fetch at the same time, updating the remote branches correctly.
Running "git reset —hard origin/master" pushes me back to the commit 26 commits behind the correct one. (presumably because git fetch is failing)
After reading comments perhaps there is a problem with my git/config.
See below:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = https://{username}@bitbucket.org/{account}/mii.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master