Reputation: 21
i am new in git. I created a folder in my Github with an intention to save some of my works from local computer. So i connected my local folder to remote folder, but i didn't use "git push -u origin master" command. Because I feel like the name of remote folder (folder that i created in github) isn't appropriate, so delete the folder and created another folder. Now i try to push my folders to new folder that i created in github. But it won't let me push the folder to github. i try using "git reset" command, but didn't work
Upvotes: 2
Views: 888
Reputation: 1319
How to setup your local repo and add it to github
Github clearly documents the steps but I'll repeat anyways.
github.com
.github.com/<user_name>/<repo_name>.git
remote
.Create your local directory.
mkdir <my_dir>
Name of your local directory need not necessarily match the one of remote but it is a good convention nonetheless.
Initialize the directory by git init
so that it is now covered by git. It need not be empty and can have some contents. You just need to ensure that you are root of your project that you are syncing to github.
Now add your github location to your local directory so that you can sync your changes to github. git remote add origin <point_1.2>
Your local directory is now connected to github and now you can use git push
to sync your local changes to github.
If you are changing your remote repo, you just need to repeat all steps from 1) and then do the one in 2.4).
Upvotes: 1