I cannot get (publish?) my repository into GitHub #22287
-
I have been programming for nearly half a century but I still am highly lost with Git and GitHub. The following is a log from Visual Studio Code.
Probably the problem is that I had a phantom repository within my main repository so I deleted it (using Visual Studio I am nearly certain, not the file system) and separately deleted it using GitHub online. So let me back up to the beginning. I have been trying to use Visual Studio (not VS Code) to get a Web App project uploaded (published?) into GitHub. I usually must stumble around but I eventualy get it to work. This time I could not. So I tried GitHub Desktop but I could not get it to work either, it just gives generic errors too. So I tried VS Code and that is what the log is from. I searched for:
And found another question that the answer probably does not apply here. I found the following in StackOverflow:
If either of those applies to my situation then I apologize for not knowing enough to understand them. It is very frustrating for me that develpers of GUI interfaces to GitHub are unable to create an interface that is independent of the command-line commands and procedures. When I finally understand Git well enough I will create a GUI the way it should be done. At the moment I just want to uplaod some sample code for a totally different question. |
Beta Was this translation helpful? Give feedback.
Replies: 11 comments
-
Hi @simplesamples , No problem if you don’t understand it - we are here to help. What exactly are you trying to achieve? If you’d just like to push (that is, I think, the most correct term to use) your local master branch to the master branch on GitHub you could use the following command:
If the GH remote is called origin (which it by default is), this will push your local master to the master on GitHub. You do need to execute this command manually, but after that automatically pushing using VS or VS Code should work fine without any manual actions from your side. Let us know if you get more errors or need additional assistance! |
Beta Was this translation helpful? Give feedback.
-
Thank you, Mark. When I use a command prompt and go to the repository’s path and issue that command I get:
So I am not sure what is happening. Since I am not experienced with the use of the command line, I am not sure where the credentials are coming from. I tried to figure that out and just doing that makes my head spin; there are so many ways to specify credentials. Well I think that since I use Visual Studio I should assume I am using whatever it uses. Anyway, to attempt to learn things I tried the following.
And that is very interesting. The most interesting part is the recentrepo. Windows allows us to specify a different partition for our “Documents” folder but it does not support it very well. Ugh! The relevant repository is in my G: (as shown in the preceding) but the preceding says C: for the recentrepo. So that is a likely problem. Right? Does that provide enough for you to suggest what to try next? |
Beta Was this translation helpful? Give feedback.
-
Hi @simplesamples , Can you post the output of git remote -v when inside the repository here? Thanks! Please check the output for sensitive information, and if so, censor it! |
Beta Was this translation helpful? Give feedback.
-
I get nothing. I tried using both Git Bash and a Windows command prompt. Both produced no output, not even an error message. I did that in the folder that has a .git directory; it has about eight projects in it. So just to see if I could get that to work I went to my local repository for First Heroku Site. There is not much there but the output of the specified command is:
|
Beta Was this translation helpful? Give feedback.
-
@simplesamples it is correct if Git then returns an empty response - it simply means you don’t have any remotes You simply need to add your own Git repository as a remote (using this article: https://help.github.com/en/articles/adding-a-remote) and then you can retry the command mentioned earlier. |
Beta Was this translation helpful? Give feedback.
-
Thank you @mpboom. I think I am making progress. After adding the remote I tried the push again and I get:
I think the part about credential—help is my mistake resulting from my attempt to figure things out. I hope it is doing nothing except produce that warning. As ar as you do not have locally that gets back to my original post, I did delete a project that I know I should not have. I deleted it both in my local and remote repositories but I should have known that Git has data about things like that. So I need to clean up what is in the remote. Would it work to just create a new remote? I have everything locally. Can I first rename the existing remote? Or I should delete the remote but if nothing else I do not mind using a different name. |
Beta Was this translation helpful? Give feedback.
-
I posted a reply but then I edited it a couple of times then it needed approval but I think now it is gone. I apologize if the following is a duplicate. Thank you @mpboom. I think I am making progress. After adding the remote I tried the push again and I got:
I think the part about credential—help is my mistake resulting from my attempt to figure things out. I hope it is doing nothing except produce that warning. As far as you do not have locally that gets back to my original post, I did delete a project that I know I should not have. I deleted it both in my local and remote repositories but I should have known that Git has data about things like that. So I need to clean up what is in the remote. Would it work to just create a new remote? I have everything locally. Can I first rename the existing remote? Or I can delete the remote but if nothing else I do not mind using a different name. |
Beta Was this translation helpful? Give feedback.
-
@simplesamples you probably made some commits to the repository online that aren’t on your computer yet. But that is no problem! Git is designed exactly for this. Do a git pull inside the repository and Git will “download” the commits you made online to your computer. If you have happend to have the same file on the GitHub site and locally, you might get a merge conflict. Even that is no big deal, just follow the instructions Git gives you and/or use this article: https://help.github.com/en/articles/about-merge-conflicts .
|
Beta Was this translation helpful? Give feedback.
-
Hopefully this is just a progress report. I am getting:
If that is expected for the situation described previously then I should be able to proceed with the merge and such. |
Beta Was this translation helpful? Give feedback.
-
Thank you. I think it is fixed. I used:
as in Solved: How to deal with "refusing to merge unrelated hist… - GitHub Community Forum. Then I did the push and now everything seems to be (“uploaded”) pushed. I do try to use proper terminology but in this situation I decided to use common terminology because some people really do not appreciate use of the wrong terminology. |
Beta Was this translation helpful? Give feedback.
-
That is great news, thank you for sharing your journey with the community @simplesamples ! |
Beta Was this translation helpful? Give feedback.
@simplesamples you probably made some commits to the repository online that aren’t on your computer yet. But that is no problem! Git is designed exactly for this.
Do a git pull inside the repository and Git will “download” the commits you made online to your computer. If you have happend to have the same file on the GitHub site and locally, you might get a merge conflict. Even that is no big deal, just follow the instructions Git gives you and/or use this article: https://help.github.com/en/articles/about-merge-conflicts .