Adding an existing project to GitHub

1.Create a new repository on GitHub

2.Initialize the local directory as a Git repository

git init

3.Add the files in your new local repository

git add .

4.Commit the files that you’ve staged in your local repository

git commit -m "First commit"

5.In the Command prompt, add the URL for the remote repository where your local repository will be pushed

git remote add origin [remote repository URL]
git remote -v

6.Push the changes in your local repository to GitHub

git push origin master

Adding an existing project to GitHub

GIT 設定

Command line instructions

Git global setup
git config --global user.name "[姓名]"
git config --global user.email "[電子信箱]"
Create a new repository
git clone [GIT專案位置]
cd [專案資料夾]
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master
Existing folder or Git repository
cd existing_folder
git init
git remote add origin [GIT專案位置]
git add .
git commit
git push -u origin master
GIT 設定