ga-wdi-boston / full-stack-project

Other
8 stars 64 forks source link

Github clarification needed #1048

Closed 3point14guy closed 7 years ago

3point14guy commented 7 years ago

I am having some conceptual problems with Github. My gh-pages branch tells me I am '1 commit ahead and 17 commits behind master'.

I have node/modules that are not commited on the gh-pages branch and when I try to git add them I get the error: 'The file will have its original line endings in your working directory.'

I have another branch with my changes for mvp that I want to merge, but I am concerned that I will mess something up because I don't fully understand how it works.

cpearce31 commented 7 years ago

First, you don't want to commit node_modules. The reason you always have to npm install when you clone one of GA's repos is because those dependencies aren't in the Github repo -- npm downloads them for you based on what's listed in package.json. By default, node_modules should be listed in .gitignore, meaning that git shouldn't even know it exists. If you see reference to node_modules in git, something is probably wrong.

To deploy, you just need to merge your changes into master, make sure that everything works, and then type grunt deploy.

3point14guy commented 7 years ago

okay. Well, in trying to fix things I did go ahead and did a commit on those node/modules. I feel like I need to undo that commit with the node_modules.

tvcrawley commented 7 years ago

You can add node_modules to your .gitignore file and commit that change.

3point14guy commented 7 years ago

Sat down with Caleb and looked over my repository. I was thinking that I had changes on gh-pages that were not on master, because gh-pages has a stripped down version of the local repository. I attempted to get gh-pages up to date, which I wasn't supposed to do. I was able to commit my branch and merge my changes.