Notes
Create a new repository and commit changes:
- From folder ~/GitHub/
cd ~/GitHub/
-
Create repository on github
- clone repository to local disk
git clone https://github.com/Barnato/SQL.git
- create a new branch to keep working changes separate from production
Git checkout -b <your-branch-name>
-
Create file. Make changes.
- Show status of current directory - which files are changed and which files will be included in the next commit
git status
- Add all files in the directory to the staging area for the next commit
Git add .
- Opens editor and creates a new commit with all changes currently in the staging area
git commit
- Push changes to github. May need to do git push –set-upstream origin feature-branch
git push
Create a pull request
-
Go to github.com/code-mates/fastpic
-
If your branch is not shown on the main page, go to the pull requests tab and click new pull request
-
Add a descriptive message and title for your pull request
-
Create the pull request
-
Wait for teammates to review pull request
-
When the pull request is approved, squash and merge it into master branch
Connect to vagrant virtual machine
- Ensure the vagrant machine is running
vagrant up
- Connect to vagrant through secure shell protocol
vagrant ssh
- Change to the working directory
cd /var/www/html
Load schema.sql into database
-
Connect to vagrant virtual machine
-
execute file with mysql
mysql -pvagrant -uvagrant < schema.sql