https://github.com/osquery/osquery logo
Title
s

Stefano Bonicatti

11/28/2022, 8:38 AM
Hello @Subash Rajaa, you should be forking the osquery repository, commit your work in a separate branch (not master) on your own repository, and then you can open a PR in the upstream repository, which points to your branch.
s

Subash Rajaa

11/28/2022, 8:39 AM
Thank you so much. I have created a local branch called fflush-consolebuufer-ungraceful-exit
I need to be able to push it in order to create a PR
s

Stefano Bonicatti

11/28/2022, 8:40 AM
Yes, but you shouldn’t be pushing it on the upstream repository. You have to create a fork of the osquery repository first, you can do that from the github website
On the top right of the osquery Github page you should see the Fork button, click it and follow the steps to create a fork. Now that you have the fork, you have to add it as a remote in the local repository.
s

Subash Rajaa

11/28/2022, 8:44 AM
ok then push the commit to the forlk ?
s

Stefano Bonicatti

11/28/2022, 8:44 AM
yep, and then back on the Github UI on the upstream osquery page, you should see a banner saying that you can open a PR with the branch you pushed to
s

Subash Rajaa

11/28/2022, 8:45 AM
so do we need to clone the fork
s

Stefano Bonicatti

11/28/2022, 8:46 AM
otherwise you can go in the Pull Requests page and use the
New pull request
button, and then click the link that says
compare across forks
. Then you select the branch
s

Subash Rajaa

11/28/2022, 8:46 AM
and create a commit against it
s

Stefano Bonicatti

11/28/2022, 8:47 AM
For right now you don’t need to; if you’ve your code ready, you can add your repo with
git remote add myosquery git@github.com:srajaa/osquery
and then when pushing you can do
git push myosquery
But after that, I normally work on my fork, so clone it, so that the remote is
origin
, and then I add the upstream repository as a remote named
upstream
(so it would be the opposite of what you have now)
s

Subash Rajaa

11/28/2022, 8:54 AM
C:\Source\osquery>git push myosquery1 kex_exchange_identification: read: Connection reset by peer fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
I am not able to get it to work...
s

Stefano Bonicatti

11/28/2022, 8:57 AM
1. Do you have an ssh key configured in your Github profile, that you’re now using to push to you repo? 2. If so, can you please execute
git remote -v
?
s

Subash Rajaa

11/28/2022, 8:59 AM
1. yes I have a personal access token
2. C:\Source\osquery>git remote -v myosquery1 git@g<mytoken@github.com>:srajaa/osquery (fetch) myosquery1 git@<mytoken@github.com>:srajaa/osquery (push)
s

Stefano Bonicatti

11/28/2022, 9:05 AM
I see, if you’re using a PAT, you need to use the https protocol. I think you should be changing the URL to
git remote set-url myosquery1 <https://srajaa>:<token>@github.com/srajaa/osquery
s

Subash Rajaa

11/28/2022, 9:07 AM
done...thank you so much