Reputation: 7784
I have received a github project url from a friend of mine who gave me r/w access to his repo. I downloaded the stuff with the "download as zip" button on github, worked on the project, but now when in neatbeans i do right click/remote/push, i enter repo informations, then it asks me to choose a local branch which i don't have because I downloaded manually the files.
So I created a local branch with the same name of the only branch of the project I can see on github, but when I do "push", nothing changes on the repo. My versions simply don't get uploaded.
Any clue ? I am new to git so sorry if I ask something which may seem obvious. THanks
Upvotes: 2
Views: 11843
Reputation: 8220
I have had this problem myself.
The solution I found was to make changes to the code, commit the changes and then push.
In short:
Hope this helps!
Upvotes: 6
Reputation: 2270
You can try the following:
git clone <url>
(now you should be on a master branch. if there is only one branch that doesn't matter, if there are other branches be sure to use the right one with git checkout
)git clone
.git status
and check if there are files need to be staged to the index (git add
)git commit -a -m "some message"
git push
Using GitHub you maybe require a ssh key or use the HTTP connection. BUT this is of course a bad solution because you treat the idea of SCM with contempt. In the future you should first connect to a repository, make your changes commit and push them. Only then you are able to do fine-grained commits and revert them if something was wrong. Commiting a large set of changes is not the right way!
Upvotes: 3