1. GitHub Basics and Source Control Basic
Command lines for Mac:
- cd – Change directory
- cd .. – up directory
- cd <directory name> – go to directory named <directory name>
- ls – will show listing of all files in your current directory
- git clone <https URL> – to copy the files in the directory
- git status – will give us update what is the difference between local files and files in GitHub repository
- git add <filename> – add <filename> to the project
- git commit – means we are locking it in to the repository
- -m “<message>“ – to add comments or notes
- git push – to upload the files to GitHub repository
- git pull – pull the updated files from Github repository
- git add -A – to add all files new files, changes and removed files (should be follow that up with git commit and git push)
- <escape key>:wq – combination key to back to normal command line if you accidentally enter git commit without a message.
2. GitHub pull request, Branching, Merging & Team Workflow
Command lines:
- git branch – to display the projects branches
- git branch <new-branch-name> – to create new branch of the master branch. It will have the complete copy of the master branch
- git checkout <new-branch-name> – to make code changes on the branch without making any changes on the master branch
- git push –set-upstream origin<new-branch-name> – to create the newly created branch to GitHub repository