Git click on remote branch

I have a remote project with a branch. So I cloned the repo first. Then follow these steps to clone to work with the branch:

git checkout -b <name> <remote_branch_name>

Then I made the necessary changes in this thread and want to do this:

git commit -a -m "changed made"

However, when I want to return to the remote branch, it just says "Everything is up to date"

git push 
Everything up-to-date

I check the cloning of the remote repo in another directory in which it did not push the changes. So how do I push my changes back to the remote branch

thank

+3
source share
1 answer

This means that you are somehow working on a detached head .

( ), . ?

origin/name

, , "".

, :

git remote -v show

:

  • , :
    git checkout --track 
    git checkout --track origin/abranchname

"abranchname" (//) "abranchname".

  • :
    git branch --set-upstream abranchname origin/abranchname
+4

Source: https://habr.com/ru/post/1749580/


All Articles