Reputation: 43
I have one repository on github. In this repository I have created one folder. Now I want to push files using git command from local folder to folder which I have created under github repository.
Can anybody help me on this?
Upvotes: 4
Views: 23800
Reputation: 101
This is working solution :
git clone https://github.com/username/file.git
cd
into file and remove everything which you already have in local(to push into remote) file except .git file using finder/file managercd
local filegit add .
git commit -m "msg"
git push
This will solve the problem.
Upvotes: 1
Reputation: 2893
If you are new to git I recommend reading a tutorial (you can find a short intro at http://rogerdudler.github.io/git-guide/).
Normally, to work with an existing remote git repository you need to have a local copy if it. You do some changes locally and push those changes to the remote repository.
git clone https://github.com/username/myproject.git
cd myproject
<make some changes locally>
git add .
git commit -m "Fixing something"
git push origin master
In your case you may need to copy the files (and create the folder in the local repository) that you want to push to github into the local repository (before git add .
).
Upvotes: 2
Reputation: 22362
You have to:
It leads to something like that:
cd yourLocalFolder
git init
git remote add origin https://github.com/<yourLogin>/<yourRepository>.git
git add .
git commit -m "Initial commit"
git push -u origin master
Upvotes: 7