git pull fails “unable to resolve reference” “unable to update local ref”

Try cleaning-up your local repository with: $ git gc –prune=now $ git remote prune origin man git-gc(1): git-gc – Cleanup unnecessary files and optimize the local repository git gc [–aggressive] [–auto] [–quiet] [–prune=<date> | –no-prune] Runs a number of housekeeping tasks within the current repository, such as compressing file revisions (to reduce disk space and … Read more

How to cherry-pick a range of commits and merge them into another branch?

When it comes to a range of commits, cherry-picking is was not practical. As mentioned below by Keith Kim, Git 1.7.2+ introduced the ability to cherry-pick a range of commits (but you still need to be aware of the consequence of cherry-picking for future merge) git cherry-pick” learned to pick a range of commits (e.g. … Read more

How do I view ‘git diff’ output with my preferred diff tool/ viewer?

Since Git1.6.3, you can use the git difftool script: see my answer below. May be this article will help you. Here are the best parts: There are two different ways to specify an external diff tool. The first is the method you used, by setting the GIT_EXTERNAL_DIFF variable. However, the variable is supposed to point … Read more

git – remote add origin vs remote set-url origin

below is used to add a new remote: git remote add origin git@github.com:User/UserRepo.git below is used to change the url of an existing remote repository: git remote set-url origin git@github.com:User/UserRepo.git below will push your code to the master branch of the remote repository defined with origin and -u let you point your current local branch … Read more

How to commit my current changes to a different branch in Git [duplicate]

The other answers suggesting checking out the other branch, then committing to it, only work if the checkout is possible given the local modifications. If not, you’re in the most common use case for git stash: git stash git checkout other-branch git stash pop The first stash hides away your changes (basically making a temporary … Read more

How do you remove an invalid remote branch reference from Git?

You might be needing a cleanup: git gc –prune=now or you might be needing a prune: git remote prune public prune Deletes all stale tracking branches under <name>. These stale branches have already been removed from the remote repository referenced by <name>, but are still locally available in “remotes/<name>”. With –dry-run option, report what branches … Read more

How to list all Git tags?

git tag should be enough. See git tag man page You also have: git tag -l <pattern> List tags with names that match the given pattern (or all if no pattern is given). Typing “git tag” without arguments, also lists all tags. More recently (“How to sort git tags?”, for Git 2.0+) git tag –sort=<type> … Read more

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