git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Deleting remote branches

From
PBPeter Baumann <waste.manager@gmx.de>
Date
Mar 26, 2010, 06:16 UTC
Message-ID
<20100326061652.GA28279@m62s10.vlinux.de>
In-Reply-To
<1269583743012-4802313.post@n2.nabble.com>
On Thu, Mar 25, 2010 at 10:09:03PM -0800, jhapk wrote:
Show 6 quoted lines
> 
> Hi,
> 
> I have tried that and I get the following message
> 
> [pradeep@scaramanga cffc]$ git push origin:test
                                      ^^^^^^^^^^^
Notice the missing space. From the git push manpage:
git push origin :experimental
               ^
    Find a ref that matches experimental in the origin repository (e.g.
    refs/heads/experimental), and delete it.

The syntax (with all the unused stuff removed) is 'git push <repository> <refspec>' If you don't supply any repository (as you did with your cmdline), the default remote repository is used. Your command tried to push the local branch 'origin' into the remote branch 'test' of your default remote repository. Correct would be

git push :test   # or git push origin :test
The refspec :test means push empy/nothingness into the branch 'test', which will delete it.

-- Peter

Previous: jhapkNext: Johannes Sixt
Message 4 of 6 in “Deleting remote branches”
  1. jhapkMar 26, 2010
  2. Ramkumar RamachandraMar 26, 2010
  3. jhapkMar 26, 2010
  4. Peter BaumannMar 26, 2010
  5. Johannes SixtMar 26, 2010
  6. Chris PackhamMar 26, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.