Version Control
Get Started with Git
Accomplish
-
Stage working code for `commit`
-
`Commit` code locally
-
`Push` code to remote repository
By the end of this module:
Before continuing:
You should have completed:
-
Module - Set your CodeSpace
- https://slides.com/shinobi881/codespace
-
Passed one of the tests in the coding challenge
Recap
What we've done so far:
-
Complete basics on using the CLi
-
Setup our Github accounts and Git CLi
-
`Fork` and `clone` a Github repo
-
`open .` To view the cloned project in our finder/explorer
-
Open our project in Sublime
-
Edit, run and pass a test in the browser. PHEW!!!
Let's Git it Started
Make viewable on your desktop:
-
Your command line interface
-
A Chrome browser with Github profile loaded
WARNING: Now is not the time for commitment issues
Steps
At the prompt `$`:
-
`git status` - view changed files
-
`git add rawstrings.js` - stage changes for commit
-
`git commit` - save changes for pushing
NOTE: You may see others use `git commit -m [commit message]` follow OUR instructions for this class
WARNING: Don't do anything else!!! (See video on vim/nano)
Default editor
After `git commit` you will taken to a default code editor. This is a sensitive environment so follow the video instructions on `vim` and `nano`.
NOTE: Be very careful wait for instructions
Time to push
We're done with committing time to push to remote
-
`git push origin master`
-
Enter your Github handle (case sensitive)
-
Enter your Github password (will be phantom)
If you run in to any errors, now is a great time to utilize your resources
Happy Coding
-
This is the end of the Git pre-course
-
Keep passing tests and keep committing
-
If you get stuck, use your resources, and review the modules.
- See the summary of git commands on the next slide
Commands
$ git status # Changed since the last commit
$ git add [file] # Stage the changes for commit
$ git commit # Commit changes to push
# Review video on vim/nano
$ git push origin master # Push changes to remote repo
HELP!!!
Google the error message from your console
Resources:
-
Google
-
Stack Overflow (community)
-
mdn.io
-
w3schools
-
Slack (community)
-
shinobi881.github.io (Git)
THE END
Next Module:
Copy of Version Control
By telegraphprep
Copy of Version Control
- 741