I discovered a minor bug in Angular's code, opened an issue on GitHub ( https://github.com/angular/angular/issues/19078 ) and now I am asked to submit a pull request but I'm not a "git pro" and however I try it doesn't work out.
What I did:
I read the guidelines: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-submitting-a-pull-request-pr
signed Google's CLA.
cloned the repo using: git clone https://github.com/angular/angular.git (was it necessary?)
edited the buggy file. (but without having the files, this step wouldn't have been possible, right?)
made my changes in a new git branch: git checkout -b my-fix-branch master
commited my changes: git commit -a
VIM opened, I put in a message, closed the editor.
commit seemed to be successful because in the terminal I see: [my-fix-branch 24f1f306e] docs typo fix 1 file changed, 1 insertion(+), 1 deletion(-)
tried to push it: git push origin my-fix-branch
typed in my GitHub credentials.
And now I face the error message: remote: Permission to angular/angular.git denied to swirlsky.
fatal: unable to access 'https://github.com/angular/angular.git/': The requested URL returned error: 403
First I should complete this, and only after that I should open a pull request on GitHub, otherwise how could they know what changes I made in the code, right? ...and for that, will this one be the appropriate page: https://github.com/angular/angular/compare/master...4.4.x ?
You have to fork angular using the fork button on the top right corner
You will have a new repo at yourusername/angular, work and push on it.
Then, you'll be able to submit a pull request
Related
I just created a new repository on GitHub and trying to initially push my local Java project.
I added the ssh key in my GitHub account, and it's referenced correctly by Eclipse, I assume.
I only get this error message when I'm trying to push:
Can't connect to any repository:
git#github.com:MaximStein/MyProject.git
(git#github.com:MaximStein/MyProject.git: Missing unknown
366362as232d670123a2267b4879bbd01d142426)
Any ideas?
Your Git repository seems to be broken or at least in an invalid state.
The root cause seems to be Missing unknown 366362as232d670123a2267b4879bbd01d142426 which means something (probably the HEAD) points to the object with the hash 366362as232d670123a2267b4879bbd01d142426 (which will be stored in the file .git/objects/36/6362as232d670123a2267b4879bbd01d142426) that does not exist.
In the Git History you might right-click the last commit and choose Reset > Soft (HEAD Only). If commits are missing, you might be able to recover them via the Git Reflog view.
Make also sure your Eclipse and EGit/JGit is up to date (for instance, there was an issue causing a Missing unknown error that has been fixed more than four years ago) and that you do a refresh (F5) in Eclipse after you have executed Git operations on the command line.
Try first if the push would succeed from command line (which means you need in to install Git first):
check you are correctly identified with ssh -Tv git#github.com
check your remote origin URL: git remote -v
check your local status (git status: to make sure you are on a branch, here I assume main, and that you have made at least one commit)
check your initial push: git push -u origin main
Check also if you have declared any submodules (.gitmodules file), or look for any nested Git repository (.git subfolder anywhere beside your repository root folder)
It is helpful to rule out (or not) a git-core issue, before investigation an Egit/JGit one.
And the OP Maxim confirms in the comments:
It's a good idea to try it in the command line first.
It says "fatal: bad object HEAD" when I do git status.
I think I've only made one local commit for that project.
Indeed, making local commits, in a branch, is a prerequisite to pushing anything.
In your case, do a git branch -avv to check if there are any.
If you already pushed that missing commit, assuming your main branch is main (not master):
git fetch origin
git reset --soft origin/main
I've been giving GitHub's Atom editor a try but am struggling to get the GitHub integration to work. I cloned a repository from my account and cannot push the changes back to GitHub.
I just added a test file called "otherfile.html", committed those changes, and tried pushing it. It comes up with a login for GitHub twice were I enter my username ans a Personal Access Token (I have two-factor authentication setup). Then it gives me this error message:
The tip of your current branch is behind its remote counterpart. Try pulling before pushing again. Or, to force push, hold cmd or ctrl while clicking.
Not sure if it is related, but the GitHub tab says this:
No Pull request could be found fo the branch master on the repository gabrielewig/gabrielewig.github.io
You can manually pin a GitHub pull request to the current branch by entering its URL:
Any help would be appreciated! The exact repo can be found here: https://github.com/gabrielewig/gabrielewig.github.io
First, switch to command line to see what git status give you.
And do a git pull if it still mention your master branch is behind its remote counterpart.
Second, check your git config credential.helper value.
On Windows for instance, the GCM helper would need your username/password (not PTA) in order to create a PTA.
Finally, do check "Improved pull request experience in GitHub for Atom" (Sept. 2018)
we’ve added a pull request list view. Now you can see the most recent pull requests in the GitHub tab Ctrl+8 with information such as:
Author’s avatar
Title of the pull request
Pull request number
CI status
“Last Updated” information
In addition to seeing more information about your existing pull requests, you can also open a new pull request directly from Atom.
I have started to contribute to a public repository on GitHub, but after I have created a pull request it says remote: Permission when I am trying to push another code to my origin.
remote: Permission to una/CSSgram.git denied to Pradhvan. fatal:
unable to access 'https://github.com/una/CSSgram.git/': The requested
URL returned error: 403
Anyone else having the same problem. The issue would be you had cloned the repo from Github of the owner(here Una's repo) and you are pushing that change directly to the repo. This is the not right way as you don't have permission to push changes to that repo.
The right step would be:
Fork the original repo so you get a copy of it. Url of your forked repo would be something like https://github.com/<your Github username>/<repo_name>
Clone the repo that you just forked.
Create a branch (git checkout -b "MyPatch1") and now make the changes to the code.
Push the changes to your fork (git push origin MyPatch1)
Open Github and go to the owner's repo and you would see a button appear Click the Compare & pull request button.
Congratulation! You have successfully created a pull request.
PS: The funny thing is this question just showed up after 4 years. xp
This is my first day at using GITHUB and I am stuck with this issue despite lot of googling. Her are the steps which I have done so far
cloned a repository
git clone https://github.com/OfficeDev/Complete-Me-Code-Sample.git
Now since I don't want to corrupt the main branch, I created my own branch
git branch validation
Now I switched to my branch
git checkout validation
Now I made all my changes locally. After this I created the remote branch
git remote add validation https://github.com/OfficeDev/Complete-Me-Code-Sample.git
Now I try to uploaded all my code
git push complete-me-code-sample validation
it asks me for user name and password and then gives me an error
fatal: 'complete-me-code-sample' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
But isn't git open for everyone? or do I need to contact the owner of this project and ask for rights? if yes, what rights I should ask for?
At this point of time, I am finding too much information and its hard for me to proceed without doing a PHD.
Can you please tell me how I can checkin my code ... as well as point me to a resource which can teach me git without too much RTFM.
Your error is simple and it's git related, not github. Here it is:
Now I made all my changes locally. After this I created the remote branch
git remote add validation https://github.com/OfficeDev/Complete-Me-Code-Sample.git
This is not how you create a remote branch, in here you've added another origin (named validation), which basically is another clone of the same repo. You said that other repo is located at that address which is not true, as nothing exists there.
When you git push if the remote branch doesn't exist it is created by default, so if you simply skipped that step the branch would have been created fine.
The correct and optimised steps should have been:
git clone https://github.com/OfficeDev/Complete-Me-Code-Sample.git
// Creates and changed branch at the same time
git checkout -b validation
// You'll need to commit files first, just in case you missed that
git commit -am "my sample commit"
// Depending on how you set up the repo git push could be enough
git push origin validation
Try this and let me know how it went.
I accidentally made a wrong pull request and ended up closing the request myself. It's in a closed state right now but it's accessible via direct URL and showing on my activity bar.
Is there any way to delete a pull request completely so it's no longer accessible via URL or shows up on your activity history?
There is no way you can delete a pull request yourself -- you and the repo owner (and all users with push access to it) can close it, but it will remain in the log. This is part of the philosophy of not denying/hiding what happened during development.
However, if there are critical reasons for deleting it (this is mainly violation of Github Terms of Service), Github support staff will delete it for you.
Whether or not they are willing to delete your PR for you is something you can easily ask them, just drop them an email at support#github.com
UPDATE: Currently Github requires support requests to be created here: https://support.github.com/contact
5 step to do what you want if you made the pull request from a forked repository:
reopen the pull request
checkout to the branch which you made the pull request
reset commit to the last master commit(that means remove all you new code). Command: git reset --hard commit_hash_here
git push --force
delete your forked repository which made the pull request
And everything is done, good luck!
This is the reply I received from Github when I asked them to delete a pull request:
"Thanks for getting in touch! Pull requests can't be deleted through the UI at the moment and we'll only delete pull requests when they contain sensitive information like passwords or other credentials."
It's very easy actually:
You can empty it, that's the best you could do.
Go to your local
Copy your local branch unwanted-branch (against which the PR was opened) to a new branch new-branch. This copying is relevant if you want to back it up for any reason. Otherwise go to step 3.
$ git branch -b new-branch
$ git merge unwanted-branch
$ git push
Empty the unwanted-branch
$ git checkout unwanted-branch
$ git reset --hard HEAD~n #n is the number of commit the branch has
$ git push -f
Enjoy, your PR is empty and closed now ;). Go to remote and delete the unwanted-branch if it bothers you.