I'm not an expert in git.
I've a repo online with master. I created a dev
branch using git checkout
.
Now I want to commit some local changes just to dev
branch.
So i did.
git add file
Then
git commit -m "Dag acquisizione"
I got message
C:\Users\marco.fumagalli\GAIMPORT\dev>git commit -m "Dag acquisizione"
[origin/dev (root-commit) 8ed7bd4] Dag acquisizione
1 files changed, 236 insertions(+)
Which seems ok to me.
Then if I do
git push -u origin dev
I got an error:
error: src refspec dev does not match any. error: failed to push some refs to 'http://marco.fumagalli@****///*****.git'
You are currently on a branch named origin/dev
, not dev
. You probably created your branch with:
git checkout -b origin/dev
or something similar.
To fix it, first rename your branch to dev
:
git checkout origin/dev # in case you are not on it already
git branch -m dev
then push it as you did:
git push -u origin dev
:+1: to you to use -u
by the way.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments