Git Guidelines - AlanJonesDIT/SGM2Assignment GitHub Wiki
First Time Initiation
-
Clone repository to local master branch (where you will be working on the assignment)
git clone https://github.com/AlanJonesDIT/SGM2Assignment.git -
Move into repo directory
cd SGM2Assignment -
Create and move into own local branch (used for commits)
git checkout -b *****
-where ***** is the name of your own branch -
You will see the name of the newly created branch appended to the end of your current directory in the shell.
This is the branch you will need to work in so that when you make a commit it will be added to this branch. Pull requests can later be made to merge the changes to this branch into the master branch.
Committing your work
When finished a section of work you need to commit to your own branch
-
Check current status of files that have been modified
git status -
Depending on the shell you are using the following colors may differ. Using the Git Bash Shell on windows the modified files/directories will show in red and new files/directories will show in green.
-
Add all changes to your commit
git add -A -
Add a message to explain the commit you are making and make the commit (eg. 'Adding new asset files')
git commit -m 'your message' -
Before pushing your commit to the repo, make sure all changes to the live repo are reflected in your local directories
git pull origin master -
Push your commit to the repo
git push origin *****
(where ***** is the name of your own branch)