How to load the project into Github

184 views Asked by At

When I load my project into Github, it writes me "Commit is failed". I use bower and nodeJS, and I think that problems is about it, but I need to download these catalogs. What I need to do, or may be it can be done in another way?

enter image description here

3

There are 3 answers

6
Andy On BEST ANSWER

These folders should be installed/populated via a dependency manager at install time (npm and bower, respectively).

You should create a .gitignore file in the root of your project as per this. This should be added to git so it is cloned with the repository on other machines too.

# cat .gitignore
node_modules
bower_components

There's also a webservice to generate .gitignore files, that's very comprehensive. This is for node and bower:

# Created by https://www.gitignore.io

### Node ###
# 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

# node-waf configuration
.lock-wscript

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

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules


### Bower ###
bower_components
.bower-cache
.bower-registry
.bower-tmp
1
Henrik Andersson On

You shouldn't commit node_modules nor bower_components. You should save your dependencies in a package.json and bower.json respectively and when cloning / checking out your project you should install your dependencies.

Add node_modules/ and bower_components/ to your .gitignore (read here about editing your .gitignore) will make git "forget" that these directories exists. This will also decrease the size of your project.

In order to create a package.json if you're lacking but already have installed dependencies you can use npm shrinkwrap.

3
Manwal On

You should not have to commit node_modules and bower_components

Solution: If you already have .gitignore file then edit it, or if you don't have create it and edit. Add path of node_modules and bower_components. Like:

node_modules
bower_components

The way to ignore directories automatically.