Why does "git push" work after doing "git push origin --delete BRANCHNAME"? -


sometimes want delete remote branch , push again,if instance have amended commit locally had been pushed. (don't worry, if 1 working on branch).

after "git push origin --delete branchname", can follow "git push".

if branch has been deleted, why "git push" work?
why not need "git push -u origin branchname" again?

to illustrate larsks' comment, here repo local branch tracking upstream branch:

c:\users\vonc\prog\b2dpres>git br -avv * prez                  13a1c36 [origin/prez] 20150923 

pushing deletion of branch:

c:\users\vonc\prog\b2dpres>git push origin --delete prez https://vonc@github.com/vonc/b2d.git  - [deleted]         prez 

that doesn't change local config:

c:\users\vonc\prog\b2dpres>git config --local --get-regexp branch.prez branch.prez.remote origin branch.prez.merge refs/heads/prez 

nor delete local branch:

c:\users\vonc\prog\b2dpres>git br -avv * prez                  13a1c36 [origin/prez: gone] 20150923 

(note "gone")

a simple git push know push (the local current branch prez) (to origin) , branch (to tracking branch origin/prez)

c:\users\vonc\prog\b2dpres>git push counting objects: 10, done. delta compression using 4 threads. compressing objects: 100% (9/9), done. writing objects: 100% (10/10), 763.97 kib | 0 bytes/s, done. total 10 (delta 2), reused 1 (delta 0) https://vonc@github.com/vonc/b2d.git  * [new branch]      prez -> prez 

it recreates branch on remote side.


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -