If you do not have a GitHub account yet, then create it first - GitHub signup.
-
Create a new repository in GitHub.
-
Using terminal or another command-line tool, create a new folder to your project in a location you want.
mkdir your_project_name
-
Get into the new project folder
cd your_project_name
-
Create a local git repository
git init
-
Connect local and remote repositories
git remote add origin URL_TO_REPO
-
Check for the changes and pull the latest code from GitHub
git pull origin main
-
Write code; make your changes. When you are done, add your changes to staging.
git add .
-
Commit your changes
git commit -m "write a short title for your changes you are committing"
-
Push your changes to the remote repository
git push origin main
In a nutshell:
- make remote repo
- make local repo
- connect remote and local
- pull changes from remote to local
- make changes and then add changes
- commit changes
- push changes
-
Create a new repository in GitHub.
-
Using terminal or another command-line tool, create a new folder to your project in a location you want.
mkdir your_project_name
-
Get into the new project folder
cd your_project_name
-
Create a local git repository
git init
-
Add a README file
echo "# Project title" >> README.md
-
Add your changes to staging.
git add .
-
Commit your changes
git commit -m "first init"
-
Connect local and remote repositories
git remote add origin URL_TO_REPO
-
Push your changes to the remote repository
git push origin master
In a nutshell:
- make remote repo
- make local repo
- make README file
- add changes
- commit changes
- connect remote and local
- push changes
- pull latest code from remote repo
- make your changes
- add your changes to staging
- commit your changes to staging
- push your changes