“Updates were rejected because the remote contains work that you do not have locally.” after creating a new repository on GitHub

This happens if you initialized a new github repo with README and/or LICENSE file git remote add origin [//your github url] //pull those changes git pull origin master // or optionally, ‘git pull origin master –allow-unrelated-histories’ if you have initialized repo in github and also committed locally //now, push your work to your new repo … Read more

How do I comment on a Github pull request for a binary file that isn’t shown

Update April 2023: Commenting on files in a pull request is now generally available (Apr. 2023) Commenting on files (including deleted, binary, and renamed files) in a pull request is now generally available on the web and GitHub Mobile! A special thank you to everyone that provided feedback during the public beta. API support is … Read more

Is there a force push option in GitHub Desktop?

Update Jan. 2023: GitHub Desktop improves force pushing and fetching along with many great open source contributions (Jan. 2023) GitHub Desktop 3.1.5 improves support for force pushing and fetching through the newly added Repository menu items as well as supporting pull request notifications on forks. Previously, a user could only force push after an action … Read more

Making a Git project open source when you have secret keys

You could remove the secret keys using the git-filter-repo tool, see this explanation in the GitHub documentation. git-filter-repo is much preferable to the older git filter-branch. My old, now somewhat out-of-date answer: You could remove the secret keys from the repository using a hammer like git filter-branch. There is a nice explanation on GitHub’s help … Read more

Give permissions on project folder in github

There is no such access-rights-mechanism implemented on GitHub repositories out of the box. Using a submodule Using a submodule does the trick, and is pretty much easy to set up. You can give the customers full access to the submodule repository, while you add it to your main project repository. Note that the StackOverflow question … Read more

How does git know which ssh key to use for its operations?

Git does not know, or care. It just runs ssh. How does ssh know? It looks at your ~/.ssh/config file (edit: or gets it from ssh-agent; see below): Host github.com # IdentitiesOnly yes # see below to decide if you want this IdentityFile ~/.ssh/github_id_file Host domain.com IdentitiesOnly yes # again, see below IdentityFile ~/.ssh/another_id_file Edit: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)