Upload local repository to github.com

  1. You first need to create a GitHub repo "without a README.md" file.

  2. On the next page,GitHub itself displays you the commands you need to run to push/upload your local repo.

  3. Go to your local repo through the terminal, paste those commands and you'll be good to go.


It looks very basic question still follow the below steps

Step 1 : You need to create git hub repository first

Step 2 : Then copy the URL of git hub repo

Step 4 : Then add remote for the git hub repo (git remote add origin "copied repo URL")

Step 3 : Then clone the repo (Redme files will cloned ) (git clone "copied repo URL")

Step 5 : Then add file (git add * or git add . or git add file name)

Step 6 : git commit -m "your message"

Step 7 : The push it (git push origin "branch name")

Login to git-hub and check you Repository


Add a new repository in GitHub and then in the folder on your computer that you want to upload to GitHub run the following commands (changing my_username and my_project to your situation):

git init
git add .
git commit -m "initial commit"
git remote add origin https://github.com/my_username/my_project.git
git push --set-upstream origin master

Notes

If this is your very first time setting up git on your local machine, then you need to add your username and email:

git config --global user.name "Bob"
git config --global user.email [email protected]

In the future when you make changes you can simply do the following:

git add .
git commit -m "description of what I changed"
git push

I also use git status a lot to see what has changed or is ready to commit.

Tags:

Git

Github