This passage covers the major steps of deploying your local project (files in a well-structured folder) onto a Github repository. Here we take
~/Desktop/XGBoost as an example, in which I have three
Python scripts and a
Readme.md doc. Make sure you have the command line tool
Git installed already.
Terminal.app and enter the directory of the folder.
(2) Initialize the directory to a
Now you’ll see a
.git file (which is hidden actually, but you can opt to show hidden files using terminal commands) in the folder
(3) Add all files into the local
git add .
You can substitute
. with the files you want to add, e.g.
main.py, if not all items in the directory do you want to deploy.
(4) Deploy your local project to
git commit -m "Initial commit"
Github. Create a new repository named
XGBoost or whatever. Copy the
.git url of your repository, e.g.
(6) Go back to the terminal and type the following.
git remote add origin https://github.com/allenfrostline/xgboost.git
(7) Run the following script to see if you’ve seccessfully deployed your files.
git remote -v
(8) Any time in the future if you want to deploy/update your files, run under the same directory:
git push origin master
Refference: Adding a file to a repository using the command line