Why can't I push to remote?
> git status
On branch main
Your branch is ahead of 'origin/main' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
> git push
> git push --verbose
I didn't forget the output, It just isn't there. This never happened to me.
In my little experience, 95% of the times the problem with git has to do with credentials. So I tried forcing git to ask me for them:
> git push -v --verbose
nothing.
I was pushing happily this morning, didn't touch anything in between...
CodePudding user response:
You would need to check what version of Git you are using, with which OS and what environment variables are set (a GIT_DIR
or GIT_WORK_TREE
for instance could influence a command like git pull
)
But try also the same operation from a different tool (like a Visual Studio Code for instance, or an Eclipse, the later one using its own Java-based Git, called JGit). That way, you would know if the behavior is consistent or not.
CodePudding user response:
Try Checking if you have remote a repository
git remote -v
if you have then
git push <yourbranchname>
Or... Change something a commit again
- Try to change a file
git add <file>
git commit -m 'commit'
git push