How to push an improved function to your project ? #77
Replies: 4 comments
|
Whoops! I think everyone makes this mistake at least a few times in their careers, and continue to make this from time to time because its easy to do if you're not paying attention, pressed for time, etc. One nice thing about git is that you can probably get yourself out of nearly any bind you can get yourself into, by accident. You would really have to be deliberate and go out of your way to put yourself into a situation that was impossible to recover from. That said, any kind of unsticking yourself from a situation using git is going to require using git on the command line, and using git on the command line can be quirky, tedious and daunting. While there almost always exists some magic incantation that does precisely what you are looking for, finding it, and understanding it well enough to feel confident you are not going to dig yourself a deeper hole, can be difficult and time consuming. A Fork in the RoadFirst, I'd ask if was done on a fork of the repository or not? Looking at the repositories on your account, it doesn't appear this is the case, so I am going to proceed to answer under the assumption that the answer is 'No'. For those who have come here with the same problem, but who's answer to the above question is Yes, your situation is less complicated, and you can, if you want, skip to Step # 5 and straight to the git command(s) to move your local commit into a different branch that's not main. If you did not do this to your own fork, however, just moving your local commit out of main and into another branch wont get you too far, as you likely will be just as unable to push that new branch to the repository if you don't have commit access to it. You solution will involve moving your local commit into a different repo. I am going to first give a high-level overview of what we are going to do first, as I think that will aid in your overall understanding if you have the big-picture idea in mind and where we are going. I hate blindly following directions without any context for understanding them in, or any idea why, and I presume you do as well. Without delay:
And then, at this point, you are welcome to submit a pull request on my repo, and should be able to select your branch on your fork as the branch to merge into mine. Onward: 1. Fork This Project!So first, you will need to fork my repo. 2. Finding the Remote
|
|
Hello Adam, thanks to help me and the big work to write it. I have done what you explain until point 4. At this point, I encountered followed problem The repository exist on my personal GitHub space and it contains only a branch named What can I do now to unlock this situation ? Must I do a On my PC in Thanks for any help. |
|
I realize you may have already gotten past this, but I wanted to answer your question for the purposes of posterity. I referred to this page and followed my steps above recently when I wanted to do the same thing at work, and indeed encountered the same problem at the same step as you mention. I will edit my tutorial above appropriately to include this correction, so hopefully in the future, I or someone else can follow them and achieve success. For brevity, Ill just get right to the answer without providing too much detail or caveats for scenarios that seem unlikely for those following this tutorial: Assuming
Lets break this command down:
Anyways, I believe by replacing step 4 with the above command, you should be able to continue on to Step 5 without modification. I will update the tutorial above to reflect this, replacing what was said before with this corrected step, so as to keep the tutorial as clean and straightforward as possible. |
|
Sorry Sorry Sorry to keep this message. |




Uh oh!
There was an error while loading. Please reload this page.
I'm new in using
Github.One month later I made a Pull Request.
I change your code locally on my PC.
Today, I want to push my work so that you can read it and perhaps integrate it in your final solution.
When I click to push my work on Github, Visual Studio 2022 indicates that there is an error without displaying which !
So, finally, I succeed to push my change
locally... but only locally.How can I push my work on your
Githubproject ? Whichgitcommand can or must I use ?All reactions