我创建了一个新的节点项目,package.json没有上传到Git

时间:2015-02-27 02:05:27

标签: node.js git github

我做了以下

npm init

然后我将它添加到我的存储库中。由

git status
git add .
git commit -m "Initial Commit"
git push origin master

现在我访问了我的仓库,我的package.json不存在。我做错了吗?

我有一个gitignore,它看起来像下面的

# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# Commenting this out is preferred by some people, see
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
node_modules

# Users Environment Variables
.lock-wscript

 git status

揭示以下内容

On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)

    .DS_Store

nothing added to commit but untracked files present (use "git add" to track)

的package.json

{
  "name": "FXTrader",
  "version": "1.0.0",
  "description": "A web application to show data about Foreign Currency.",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/username/FXTrader"
  },
  "author": "Me MySelf",
  "license": "NONE",
  "bugs": {
    "url": "https://github.com/username/FXTrader/issues"
  },
  "homepage": "https://github.com/username/FXTrader"
}

0 个答案:

没有答案