How to switch a remote repository to a different branch

Below is my method to switch and work for a remote branch of a Git repository. Have a look for all the branches first, just input following command in the terminal: git branch –all And then you will see the all the branches on local and remote. Something like this: *master remotes/origin/develop remotes/origin/master remotes/origin/web remotes/origin/app … Read more

How to list unpushed Git tags

You can use the following to see the tags that exist locally but not in the specified remote: git show-ref –tags | grep -v -F “$(git ls-remote –tags <remote name> | grep -v ‘\^{}’ | cut -f 2)” Note that git ls-remote shows both the annotated tag and the commit it points to with ^{}, … Read more

git push to remote repository “Could not read from remote repository”

In this case, using openssh over putty was key. Original answer (tips for debugging) I can log in via ssh with the git user. That means this works: ssh git@serverIp You do have a HOME variable defined, and ssh public/private keys (id_rsa / id_rsa.pub) in %HOME%/.ssh/. This question suggests a different url: git remote set-url … Read more

What is the difference between push.default “matching” and “simple”

git push can push all branches or a single one dependent on this configuration: Push all branches git config –global push.default matching It will push all the branches to the remote branch and would merge them. If you don’t want to push all branches, you can push the current branch if you fully specify its … Read more

Track multiple remote branches

How to track more than one remote with a given branch using Git? In short, “can’t be done unless you write a custom script/program/alias”. I suggest that they either agree on a common central branch that holds the development tree, or that they send each other pull requests instead of asking each developer to track … Read more

EGit: Pruning Remote Tracking Branches that have been Deleted on the Remote Repo

Update March 2014: As mentioned by cheshire’s answer, EGit 3.3 added that prune feature. You can see said feature introduced in this Gerrit code review in JGit (and tested here) The entry fetch.prune mentioned in git config can be added to your Egit configuration: Original answer (March 2013) EGit perform this pruning when remote tracking … Read more

What is the difference between ‘origin’ and ‘remote’ in git commands? [duplicate]

In git lingo origin is just the default name for a remote from which a repo was originally cloned. It might equally have been called source or remote1 or just remote. Remember that git is a peer-to-peer, distributed system, not one with any built-in notion of client/server, master/slave, parent/child relationships (though these might be imposed … Read more

tech