I have a git repository which exists fully locally inside my PC. I want to create remote clone of it onto the github.com. How can it be done?
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
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.
You first need to create a GitHub repo "without a README.md" file.
On the next page,GitHub itself displays you the commands you need to run to push/upload your local repo.
Go to your local repo through the terminal, paste those commands and you'll be good to go.
my way to upload existing local repository
name "origin" and "main" up to you. make sure you are logged in on local git bash
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With