Git will not be deleted to the “All Updated” remote branch,

I reviewed the current solutions here for the problem I ran into, but their answers don't seem to solve the problem of getting push to work.

I have a local branch named "dev" that is supposed to be tracking the remote branch "v1.0-7.22-dev".

I cloned the repo and checked the remote branch "v1.0-7.22-dev" as the local "dev".

I made a commit for my local "dev", and when I run the git status, I get the following:

$ git status # On branch dev # Your branch is ahead of 'origin/v1.0-7.22-dev' by 3 commits. # nothing to commit (working directory clean) 

When I commit:

 $ git push Password: Everything up-to-date 

My configuration file ( server name and repo name has been edited )

 [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* url = ssh://[server-URL]/[remote-repo-directory] [branch "master"] remote = origin merge = refs/heads/master [branch "dev"] remote = origin merge = refs/heads/v1.0-7.22-dev 
+4
source share
2 answers

Try:

 git push origin dev:v1.0-7.22-dev 
+2
source

You have a local dev branch that tracks the remote v1.0-7.22-dev branch at the beginning.

If you just say git push , you don’t explicitly specify what to push, where the result also depends on the value of git config push.default .

If this value is not set, older versions of git by default redirect all local branches to the remote branch with the same name. (In your case, this would create the dev branch by origin, but as you track v1.0-7.22-dev , you will still be ahead of it.)

You probably want to set push.default to upstream . Then a simple git push will push its configured branch upstream. “Just as you expected it to be.”

+3
source

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


All Articles