Remote origin already exists on ‘git push’ to a new repository

You are getting this error because “origin” is not available. “origin” is a convention not part of the command. “origin” is the local name of the remote repository. For example you could also write: git remote add myorigin git@github.com:myname/oldrep.git git remote add testtest git@github.com:myname/oldrep.git See the manual: http://www.kernel.org/pub/software/scm/git/docs/git-remote.html To remove a remote repository you enter: … Read more

Undoing a ‘git push’

You need to make sure that no other users of this repository are fetching the incorrect changes or trying to build on top of the commits that you want removed because you are about to rewind history. Then you need to ‘force’ push the old reference. git push -f origin last_known_good_commit:branch_name or in your case … Read more

What are the differences between “git commit” and “git push”?

Basically, git commit “records changes to the repository” while git push “updates remote refs along with associated objects“. So the first one is used in connection with your local repository, while the latter one is used to interact with a remote repository. Here is a nice picture from Oliver Steele, that explains the Git model … Read more

Force “git push” to overwrite remote files

You should be able to force your local revision to the remote repo by using git push -f <remote> <branch> (e.g. git push -f origin master). Leaving off <remote> and <branch> will force push all local branches that have set –set-upstream. Just be warned, if other people are sharing this repository their revision history will … Read more

Git push error ‘[remote rejected] master -> master (branch is currently checked out)’

The error message error: refusing to update checked out branch: refs/heads/master is emitted by the remote repository and it means you’re trying to push code to remote non-bare repository that has different code currently checked out in the working directory. The best way to avoid this problem is to push to bare repositories only – … Read more

Git push requires username and password

A common cause is cloning using the default (HTTPS) instead of SSH. You can correct this by going to your repository, clicking “Clone or download”, then clicking the “Use SSH” button above the URL field and updating the URL of your origin remote like this: git remote set-url origin git@github.com:username/repo.git You can check if you … Read more

Is there a way to cache https credentials for pushing commits?

Since Git 1.7.9 (released 2012), there is a neat mechanism in Git to avoid having to type your password all the time for HTTP / HTTPS, called credential helpers. You can just use one of the following credential helpers: git config –global credential.helper cache The credential.helper cache value tells Git to keep your password cached … Read more

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