Giter Site home page Giter Site logo

deleteBranch about isomorphic-git HOT 14 CLOSED

isomorphic-git avatar isomorphic-git commented on May 22, 2024
deleteBranch

from isomorphic-git.

Comments (14)

billiegoose avatar billiegoose commented on May 22, 2024 2

@bokuweb You rock! I would lean towards separate commands e.g.

Create stuff:

  • add
  • branch
  • tag

List stuff:

  • listFiles
  • listBranches
  • listTags

Delete stuff:

  • remove
  • deleteBranch
  • deleteTag

Helps prevent making mistakes like accidentally delete when you meant to create, etc.

from isomorphic-git.

billiegoose avatar billiegoose commented on May 22, 2024 2

What about pushing changes after removing branch locally?

Add a delete: boolean parameter to the push command that sets oid to... I think it's 20 zeros? No, 40 zeros. (20 bytes, in hex). It's something like that.

At least... that would be the way to do it that most resembles the git CLI. It would actually tree-shake better to make deleteRemoteBranch its own function.

Edit: Yeah I'm leaning towards adding a deleteRemoteBranch command.

from isomorphic-git.

bokuweb avatar bokuweb commented on May 22, 2024 1

@wmhilton Thanks :) I'll try to implement if get a chance.

from isomorphic-git.

TomasHubelbauer avatar TomasHubelbauer commented on May 22, 2024 1

How'd deleting a branch actually work? I think it would mean removing a Git ref, right, because branches are refs and refs are Git objects? Can you post a quick and rough rundown of what it would entail?

Edit: "ninja-edit" after a good nights sleep to use actual English grammar and shizz

from isomorphic-git.

billiegoose avatar billiegoose commented on May 22, 2024 1

🎉 This issue has been resolved in version 0.22.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

from isomorphic-git.

knownasilya avatar knownasilya commented on May 22, 2024 1

I don't see a delete remote branch in the docs, is there a way to do that?

from isomorphic-git.

crutchcorn avatar crutchcorn commented on May 22, 2024 1

Is there plans to implement something along the lines of deleteRemoteBranch? If not, are we able to create a GH issue for tracking purposes?

from isomorphic-git.

aborba-simeon avatar aborba-simeon commented on May 22, 2024 1

Is there plans to implement something along the lines of deleteRemoteBranch? If not, are we able to create a GH issue for tracking purposes?

Any updates on this?

from isomorphic-git.

jcubic avatar jcubic commented on May 22, 2024 1

You need to create another issue for this. Also if you want this to be added to the library someone needs to write the code, the main author left the project so it's up to contributors like you to implement this.

from isomorphic-git.

bokuweb avatar bokuweb commented on May 22, 2024

@wmhilton Hi :) I'll implement this command. So, should I implement it with either deleteBranch command or branch command with --delete option ?

from isomorphic-git.

billiegoose avatar billiegoose commented on May 22, 2024

Yes! So, basically all a deleteBranch command needs to do is:

  • delete ${gitdir}/${GitRefManager.expand({ref})}
  • delete the line in ${gitdir}/packed-refs if it exists

from isomorphic-git.

billiegoose avatar billiegoose commented on May 22, 2024

If you want to get super fancy about it, the ideal implementation would be to add a deleteRef function to GitRefManager and then wrap that.

from isomorphic-git.

jcubic avatar jcubic commented on May 22, 2024

What about pushing changes after removing branch locally?

from isomorphic-git.

aborba-simeon avatar aborba-simeon commented on May 22, 2024

You need to create another issue for this. Also if you want this to be added to the library someone needs to write the code, the main author left the project so it's up to contributors like you to implement this.

Excellent, thank you for the fast reply.

from isomorphic-git.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.