github is a hosting service for git. git is a program. git documentation https://git-scm.com/
Please commit changes to the "dev" branch for testing and screwing up only. We must ensure dev is stable before sending it to master branch to prevent complete loss of code and other problems.
- Generate ssh keys
ssh-keygen -t rsa -D 4096 -C "[email account]"
- Add public ssh key to Github account
- Install Github
- Add Github credentials to local machine
- Setup github on local machine
We will manually update the master branch, so all commands will apply to the "dev" branch
git config --global user.name
"[github username]"git config --global user.email
"[github email]"
git clone [URL]
//copies all the files over without needing authorizationgit pull origin dev
//Enter this command AFTERgit clone
to retrieve and synchronize changes
- Save the files you have edited
git add [file name]
// Add the specified file to a basket before commitinggit add [folder name]
//Addes all files inside foldergit add .
// Adds all the files in your current working directory/branch to the basket. NOTE merge conflicts will happen if multiple people modify the same filegit commit -m "[message]"
// Commit changes to local git repository (not github)git push
//pushes the basket full of changes to this github repository. (Note: You must pull all changes before being able to push anything)
- Note:
git push --set-upstream
//If issues arise, doing this command once should allow you to dogit push
andgit pull
without extra commands
git pull
//enter this command in the root folder
git log
// lists version history for the current branch.git checkout
//Shows all the files in after executinggit add
commandgit commit
//messages are displayed clearly here
git checkout -- [path to file]
// resets to file before you made changes to it
git status
//show.git branch
//shows which branch you are ongit checkout [branch name]
//changes and updates your working directory to that branch