forked from Inck/cooper-union-class
-
Notifications
You must be signed in to change notification settings - Fork 16
Nick's Lecture Notes with Jokes
Inck edited this page Sep 14, 2012
·
1 revision
- Versioning
- A history of everything you've done
- More like a journal for you to write that history
- An undo for anything you've done
- Without undoing everything since
- An undo for something you know you might give up on
Branching
- Or might just take a break from and go back to
- Happens a lot because of simultaneous features and bugs
- Basically like making a copy of all your files before working on them
- Or might just take a break from and go back to
- A history of everything you've done
- Git
- Stores a list of 'commits'
- A commit is a set of changes to files you decided to commit to having in your project forever and ever or until you start to hate them
- Makes branches in a smart way
- Doesn't actually copy all your files
- Just remembers what they look like right now
- With one command you can make them all look like that again
- And back and forth
- Really fast so you can and should use them all the time
- Stores a list of 'commits'
- Collaboration
- As a developer you'll usually share code with other people.
- Others on a team
- Open-source projects
- This is the other half of Git.
- Synchronizes commits between your repository and others.
- Actually 'pulls' commits and 'pushes' them.
- Can get friend's commits.
- Can put commits on another computer.
- For backup.
- For other people.
- For deployment.
- Deploying is jargon for uploading code files to a server computer where they become a web site.
- Usually it's more complicated than that.
- 'Deployed' code just a copy of the repository on the server computer.
- Aside: Who knows what a server is? "Internetz computer." Wrong, it's a program on any computer that sends people what they ask it for through the internet.
- Deploying is jargon for uploading code files to a server computer where they become a web site.
- But we're not doing that (much) today. Git is a crazy powerful, super confusing tool that is insane.
- I've been researching Git specifically for over a year.
- Joe created a Git setup at Journal that his team still doesn't really get, and stumped me for days.
- But that's why the gods of the internet (cats) invented services.
- As a developer you'll usually share code with other people.
- Services
- Services are what cool kids use.
- Only dorks and jerks build their own software unless necessary.
- Always assume someone else had an idea already and find it on the Google.
- Saves you time.
- Makes fewer things that suck.
- Makes everything better, because everyone works on one thing instead of their own redundant version of thing.
- GitHub
- Sign up.
- Has an app, which is on your computer so launch it.
- Try to install update.
- Run through setup.
- Name and email.
- Login.
- Skip adding repos.
- github.com/CooperUnionDesignTech/cooper-union-class
- Fork it.
- A copy of someone else's repo on GitHub.
- You can change whatever you want in it.
- If original gets improved, you can upgrade yours with those changes.
- If you improve yours, you can suggest to the owner of the original to upgrade theirs with your changes.
- At which point others who forked it can choose to get your upgrade.
- For now, it's just your copy to work on.
- Hit 'Clone in Mac' on your fork.
- Pick where you want the code.
- Open it in TextWrangler.
- This code is a server.
- You can ignore everything except /files, where HTML and CSS will go.
- Or read through it and learn stuff. It's all just JavaScript (kind of).
- Add a style to the CSS and save it.
- This code is a server.
- Tutorial
- Back to GitHub
- History
- The list of commits so far.
- So far just mine, setting up the server code.
- Click on it to see what I changed.
- Changes
- Commit your CSS change.
- Check the file.
- Say briefly what you were doing to the product. Not the code
- Say at length anything else.
- Push commit.
- Commit your CSS change.
- Branches
- Create a branch.
- History
- Back to TextWrangler
- Add another CSS style and save it.
- Back to GitHub.
- Commit the change like last time.
- Switch back to 'master' branch by double clicking.
- 'master' is just a name
- But everyone uses that name. It means, 'this is the real stuff that we definitely want to use, so it's probably not broken'.
- Back to TextWrangler.
- The CSS change is gone
- Because it was on your other branch not master.
- The CSS change is gone
- Back to GitHub
- Switch back to your branch and your change comes back in TextWrangler.
- Imagine possibilities.
- When you decided a branch is good stuff you 'merge' it back into master.
- Under branches, hit Merge View.
- Drag branch by stupid handle on left into left box, master into right.
- Hit Merge Branches.
- Switch back to master and your change is still there in TextWrangler.
- Switch back to your branch and your change comes back in TextWrangler.
- Back to GitHub
- We need to install the server on a computer that can run it.
- These can't because Cooper Union. It's easy to get your own (Mac) computer to.
- So we'll just put them on the web server computer.
- That would normally be a pain.
- But there's a service.
- Fork it.
- Heroku
- Sign up.
- Hides everything you don't need to know about server computers.
- But you're going to have to use the Terminal.
- Dress up '90s and pretend you're a hacker.
- Just Heroku's special Terminal tool.
- It's easy. (They have a designer for it.)
- It's the only option.
- Also one simple Git command.
- To really get Git you need to use it in Terminal.
- Or just know this one command.
- Going to the folder where you app is.
- Files and folders.
- Folders have a / and then the name.
- Relative paths.
- / (root)
- ~ (your home folder)
- . (this folder)
- .. (the folder above this)
- Use with slash.
- Stack them up: ../../.., ~/Sites/cooper-union-class/
-
pwd
('present working directory' according to Joe) -
cd
(change directory)
- Files and folders.
-
heroku
heroku auth:login
heroku help apps
-
heroku apps:create
- The name has to be unique across all Heroku.
- No one will see it once you have a domain.
- Heroku will make up a hilarious one if you enter nothing.
git push heroku master
-
heroku ps:scale web=1
- ps = 'Process,' what computers call programs.
- scale = What computer people call running more than one copy of program so lots of people can use it at once.
- web = The type of process we're running.
- 1 = You just need one unless your HTML and CSS will contain viral pictures of the cat gods.
-
heroku open
- There it is.
- Edit HTML and CSS.
- Commit and sync to GitHub.
git push heroku master
- Boom.