Creating a Git Repository
- Right click on your project folder and click “Git Bash Here”
- Initialize your repository with the command “git init”
- Go to github.com and create a new repository
- Put the command “git remote add origin (link to new repository)” in Git Bash
- Use the command “git push -u origin master”
git init: used to create a new local Git repository, can be used on both existing projects and brand new ones
git commit -m “commit message”: adds all uncommitted files to the local commit and adds a message
git remote add origin (link to GitHub repository): connects your local repository to a remote repository hosted by GitHub instead of your computer
git push -u origin master: pushes committed files to the master branch of the remote repository
git status: shows which files have and haven’t been committed and the files that Git isn’t tracking