Git Guidelines - AlanJonesDIT/SGM2Assignment GitHub Wiki

First Time Initiation

  1. Clone repository to local master branch (where you will be working on the assignment)
    git clone https://github.com/AlanJonesDIT/SGM2Assignment.git

  2. Move into repo directory
    cd SGM2Assignment

  3. Create and move into own local branch (used for commits)
    git checkout -b *****
    -where ***** is the name of your own branch

  4. 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

  1. Check current status of files that have been modified
    git status

  2. 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.

  3. Add all changes to your commit
    git add -A

  4. Add a message to explain the commit you are making and make the commit (eg. 'Adding new asset files')
    git commit -m 'your message'

  5. 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

  6. Push your commit to the repo
    git push origin *****
    (where ***** is the name of your own branch)