In this lab, you will see
//make folder
git init
//add remote repo
git remote add origin https://github.com/lauraLi035/iat381.git
//add any new files
git add .
//what's happening?
git status
//tell git what i did
git commit -am 'i made a repo'
//push to the remote repo called origin from the master branch
git push -u origin master
//add a new branch that's live on github
git branch -b 'gh-pages'
//switch to the new branch (likely won't switch back)
git checkout 'gh-pages'
//add files, commit some stuff here, first time in branch use push --all -u
git add .
git commit -am 'changes'
git push --all -u
//typically once a new branch has been pushed I just have to do
git push
What we're going to be doing in this lab (and possibly in the remainder of this semester) is use the terminal for a lot of our stuff.
Some basic commands.
cd
tells BASH to change the current working directoryls
utility to view files that are in the current working directorypwd
utility to view the current working directorytouch <file name>
create a new file (in the current working directory)mkdir <folder name>
create a new directory (in the current working directory)cp <source file name> <destination name>
copy the specified file to the destinationcp -r <source folder name> <destination name>
copy the specified folder to the destinationrm <file name>
delete a filerm -r <folder name>
delete a folderrm -f <file name>
force delete a filerm -rf <file or folder name>
force delete anythingNode.js allows you to run JavaScript without the browser (well, the implications of the existence of Node.js is a lot more sophisticated than that, but I'm not going to go to the details on that).
You can install Node.js by going to nodejs.org and then running the installer, or, if you're on OS X and some Linux distro, you would install nvm and then use that to manage Node.js versions.
npm install -g bower
bower install jquery
If you wanted to different things in a single task, you would typically create a script file.
If you wanted many task, prior to Grunt (and the like), you would have had to create many script files.
With Grunt, you simply have one file: Gruntfile.js. And it's this file that has many tasks that you can run.
Although, we're not going to ask you to create a Grunt task, but for now, just install Grunt, by running `npm install -g grunt-cli`
Yeoman is a tool for developers to easily create code generators.
In this lab, we'll be creating a simple AngularJS application.
For now, just install Yeoman, and a generator.
npm install -g yo
npm install -g generator-angular
mkdir my-app
cd my-app
yo angular myapp
angular-cookies
and angular-resource
, include angular-messages
grunt server
yo angular:controller contact
yo angular:route contact
yo angular:view contact
grunt
git init && git add -A && git commit -am 'initial commit'
git remote add origin <your repo address>
git push -u origin master
cd .. && mkdir my-app-dist && cd my-app-dist
git remote add origin <your repo address>
git checkout --orphan gh-pages
cp -r ../my-app/dist .
git add -A && git commit -am 'initial commit'
git push -u origin gh-pages