gitgithub

How to upload a local repository to Github


I am quite new to Git/Github. I am trying to upload my program / website to Github, so I can upload it to Heroku.

I tried a ton of different things, and I am stuck with this for over a week... As far as I know the way to do it is:

git init

git add .

git commit -m 'initial commit

the result I get is:

git init > Reinitialized existing Git repository in /Users/username/test/website/.git/

git add . > error: 'website/' does not have a commit checked out fatal: adding files failed

git commit -m 'initial commit >


Untracked files:

  (use "git add <file>..." to include in what will be committed)

    website/

nothing added to commit but untracked files present (use "git add" to track)

What else can I do to set my website to Github?


Solution

  • "Reinitialized existing Git repository in /Users/username/test/website/.git/",

    It looks like you already have a local git repository on your computer. Next step is to create repository in the github, get the https link and do

    git remote add origin <your repository https url>
    git add .
    git commit -m "intializing project"
    git push origin <your branch name, ex. master>