Comments (12)
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.
Great, thanks. I will be glad to give a PR.
from degit.
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.
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.
oh, ok. so, you want to get the commit of HEAD and get the branch by comparing the commits. Is that right?
from degit.
I understand now, thank you!
from degit.
I think this can get the default branch of git repository. What do you think
git symbolic-ref --short HEAD
from degit.
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.
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.
Yes, this is probably what I want.
from degit.
from degit.
LGTM.
from degit.
Related Issues (20)
- 💡 Feature Request: Fallback to isomorphic-git when git is not installed on the client
- This link is not downloading. HOT 2
- Throw error if subdirectory doesn't exist
- How many commits are stored in the .git history? HOT 2
- --mode=git doesn't seem to respect git hash provided to degit HOT 5
- `degit --help` not working. Help file is missing. HOT 2
- Error out of the box HOT 4
- Implementation for Private Repo HOT 1
- why install success , but use it error HOT 7
- feat: auto suggestion HOT 1
- Trying to get a subdirectory in git mode with the js api HOT 1
- Can degit handle template upgrading? HOT 2
- Archive HOT 6
- Files end of line change from crlf to lf with degit
- add support for Azure DevOps
- Issues HOT 1
- [Feature Request] Add the alias of a repo
- [suggestion] template string variables and/or project names
- Support Bitbucket Data Center (the self-managed Bitbucket)
- Degit a github subfolder without removing the /tree/main HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from degit.