Git for beginners: The definitive practical guide

How do you create a new project/repository? A git repository is simply a directory containing a special .git directory. This is different from “centralised” version-control systems (like subversion), where a “repository” is hosted on a remote server, which you checkout into a “working copy” directory. With git, your working copy is the repository. Simply run … Read more

Are Git forks actually Git clones?

Fork, in the GitHub context, doesn’t extend Git. It only allows clone on the server side. When you clone a GitHub repository on your local workstation, you cannot contribute back to the upstream repository unless you are explicitly declared as “contributor”. That’s because your clone is a separate instance of that project. If you want … Read more

Skip Git commit hooks

Maybe (from git commit man page): git commit –no-verify -m “commit message” ^^^^^^^^^^^ -n –no-verify This option bypasses the pre-commit and commit-msg hooks. See also githooks(5). As commented by Blaise, -n can have a different role for certain commands. For instance, git push -n is actually a dry-run push. Only git push –no-verify would skip … Read more

Permission denied (publickey) when deploying heroku code. fatal: The remote end hung up unexpectedly

You have to upload your public key to Heroku: heroku keys:add ~/.ssh/id_rsa.pub If you don’t have a public key, Heroku will prompt you to add one automatically which works seamlessly. Just use: heroku keys:add To clear all your previous keys do : heroku keys:clear To display all your existing keys do : heroku keys EDIT: … Read more

Cleaning up old remote git branches

First, what is the result of git branch -a on machine B? Second, you have already deleted heads/devel on origin, so that’s why you can’t delete it from machine B. Try git branch -r -d origin/devel or git remote prune origin or git fetch origin –prune and feel free to add –dry-run to the end … Read more

git error: failed to push some refs to remote

(Note: starting Oct. 2020, any new repository is created with the default branch main, not master. And you can rename existing repository default branch from master to main. The rest of this 2014 answer has been updated to use “main“) (The following assumes github.com itself is not down, as eri0o points out in the comments: … Read more

How to link a folder with an existing Heroku app

Heroku links your projects based on the heroku git remote (and a few other options, see the update below). To add your Heroku remote as a remote in your current repository, use the following command: git remote add heroku git@heroku.com:project.git where project is the name of your Heroku project (the same as the project.heroku.com subdomain). … Read more

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