Tag: github

bower / npm如何知道项目在哪个github用户中

当我们运行bower install angularjs或者npm install ionic ,这些工具(bower和npm)如何知道项目所在的用户(例如离子位于driftyco / ionic上 )。 另外,如果多个项目具有相同的名称,哪个项目优先?

如何使用nodejs在git repo中下载文件?

我想在没有克隆的情况下在git repo中下载文件。 例如lodash git回购: https://github.com/lodash/lodash/ 在那个git中有文件lodash.js : https://github.com/lodash/lodash/blob/master/lodash.js 我尝试使用nodegit但仍然需要首先克隆所有文件。 如何仅使用nodejs在git repo中下载lodash.js文件?

npm安装github repo strip src文件夹

我做了以下几点: npm install TuningGuide/react-sortable-hoc –save npm info it worked if it ends with ok npm info using npm@3.10.5 npm info using node@v6.2.2 npm info git [ 'clone', npm info git '–template=/Users/velten/.npm/_git-remotes/_templates', npm info git '–mirror', npm info git 'git://github.com/tuningguide/react-sortable-hoc.git', npm info git '/Users/velten/.npm/_git-remotes/git-github-com-tuningguide-react-sortable-hoc-git-78a804e9' ] npm info git [ 'rev-list', '-n1', 'master' ] npm info git […]

git通过ssh推送时如何改变用户身份?

所以我试图设置一些EC2实例的自动git推/拉。 简单地通过Node完成这个工作: var add = require('child_process').execSync('git add {FILENAME}) var commit = require('child_process').execSync('git commit -m "{COMMIT_MESSAGE}"') 我在EC2实例上创build了一个新的ssh密钥,并将其添加为GitHub仓库中的部署密钥,并允许写入权限。 除了提交作者正在作为EC2 Default User来完成之外,一切都工作正常。 我希望它是我自己的GitHub帐户 ,以便提交出现在我的个人资料等。这怎么可能?

在git中使用package.json中的分支代码

我们正在研究node.js应用程序,并且使用发布到npm的我的学院包,现在他创build了新的Git分支(我们称之为第二个),有一种方法可以在package.json中使用它,而不需要发布到npm ? (我只是想testing新的分支) 更新我尝试类似的东西 "git://github.mycompany.corp/vv/app.js.git#newbranch" 它不工作任何想法?

使用Node GitHub API在本地克隆远程回购

我正在使用Node GitHub API连接到GitHub上的回购站。 我可以成功获取我的远程仓库的参考资料: const dotenv = require('dotenv') const GitHub = require('github-api') dotenv.config() const api = process.env.GITHUB_URL const token = process.env.GITHUB_TOKEN const gh = new GitHub({ token }, api) const owner = process.env.GITHUB_REPO_OWNER const name = process.env.GITHUB_REPO_NAME const repo = gh.getRepo(owner, name) const branch = 'master' const ref = `heads/${branch}` repo.getRef(ref).then((response) => { // This […]

npm安装与开发依赖关系的<git>

处理私有npm模块的典型方法是将它们放到Git存储库中,然后使用npm install和该存储库的path来安装该模块。 如果你在你的package.json文件中input依赖项,你甚至可以使用npm install而不需要每次都指定版本库URL。 即,如果添加 "myPrivateModule": "git+ssh://git@github.com:myGitHubAccount/myPrivateModule.git" 作为依赖项,您可以使用安装 $ npm install myPrivateModule 一切工作正常:-)。 现在我有一个问题, myPrivateModule是私人的,是的,但不是一个依赖。 相反,它只是一个开发时间的依赖项,所以我把它放在package.json文件的devDependencies部分。 一旦你这样做, $ npm install myPrivateModule 不再工作,因为它现在search公共registry,而不是使用已注册的存储库path。 有没有可能做这个工作,而不需要每一次都指定完整的path?

将Azure托pipe的DocPad Node.js网站的GitHub更新部署到站点,使站点离线1-2分钟

我正在testing一个DocPad / Node.js站点的GitHub部署。 我已经部署工作,但是当一个新的推进到GitHub公共网站站点变得不可用1至2分钟,而部署正在进行中。 这似乎对我来说。 我想 DocPad静态HTML文件将由node.js生成,然后复制到wwwroot文件夹 – 从而最大限度地减less任何types的停机时间。 但是,这似乎并不是这样。 在网站正在部署访问该网站时收到以下错误信息: 页面无法显示,因为发生了内部服务器错误。 DocPad / Node.js部署的副本可以在https://github.com/Richard-West/DocPadAzureDemofind 我将不胜感激为什么会发生这种情况,如果有什么我可以修改,以防止这种情况发生。 我希望能够随时将更新推送到网站,而不会影响任何访问者。

Socket使用Node HTTP请求从GitHub API挂起错误

我正在提出以下要求: var options = { host: "api.github.com", port: 443, path: "/repos/myusername/myreponame/issues", headers: {Authorization: "Basic " + new Buffer(username + ":" + password).toString("base64")} }; var request = http.get(options, function(response) { response.on("data", function(data) { console.log("data"); }); }); request.on("error", function(error) { console.log(error); }); 这会导致一个错误: { [Error: socket hang up] code: 'ECONNRESET' } 任何想法为什么?

如何获得保存在bash脚本中的Git仓库variables

在运行postinstall到npm安装我的bash脚本我想获得一个特定的回购基地的Github远程URL。 但是,运行时提取的值是“git”,而不是我的git仓库的URL。 你将如何捕获从这个命令返回的url? #!/bin/bash … remoteBackup=git config –get remote.base.url …