Giter VIP home page Giter VIP logo

Comments (12)

Cologler avatar Cologler commented on July 19, 2024 1

oh, ok. so, you want to get the commit of HEAD and get the branch by comparing the commits. Is that right?

Yes.

from degit.

keerthivasan-r avatar keerthivasan-r commented on July 19, 2024 1

Great, thanks. I will be glad to give a PR.

from degit.

keerthivasan-r avatar keerthivasan-r commented on July 19, 2024

HEAD is just a pointer, not really a branch. It points to the latest commit that you performed in the branch you are on. you can run

git branch --show-current

to get the current branch you are

from degit.

Cologler avatar Cologler commented on July 19, 2024

It points to the latest commit that you performed in the branch you are on. you can run

Yeah, and my image showed how to get the real branch from the HEAD.

from degit.

keerthivasan-r avatar keerthivasan-r commented on July 19, 2024

oh, ok. so, you want to get the commit of HEAD and get the branch by comparing the commits. Is that right?

from degit.

keerthivasan-r avatar keerthivasan-r commented on July 19, 2024

I understand now, thank you!

from degit.

keerthivasan-r avatar keerthivasan-r commented on July 19, 2024

I think this can get the default branch of git repository. What do you think

git symbolic-ref --short HEAD

from degit.

Cologler avatar Cologler commented on July 19, 2024

I think this can get the default branch of git repository. What do you think

git symbolic-ref --short HEAD

symbolic-ref seems unable to load from remote repo.

from degit.

keerthivasan-r avatar keerthivasan-r commented on July 19, 2024

Yes, agreed. it works only in local copy. There is a default hard code value master. I think that is the problem. we will have to figure out the default branch by HEAD ref hash on the fly.

        const user = match[4];
	const name = match[5].replace(/\.git$/, '');
	const subdir = match[6];
	const ref = match[7] || 'master';

Does that right?

from degit.

Cologler avatar Cologler commented on July 19, 2024

Yes, this is probably what I want.

from degit.

keerthivasan-r avatar keerthivasan-r commented on July 19, 2024

@Cologler Please review #204

from degit.

Cologler avatar Cologler commented on July 19, 2024

LGTM.

from degit.

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.