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

Will remote URL for fetch and push be different?

Yes (using different remote), and that is why Git 2.5 introduces a new ref shorthand @{push}. See “Viewing Unpushed Git Commits” What commands can you use to change remote URL for fetch or push separately? You need a separate remote: git remote add myfork /url/for/my/fork git config remote.pushdefault myfork The GitHub blog post “Improved support …

Read more

How do I add a remote Git repository to an Ubuntu Server?

git remote add origin jonas@192.168.1.10/home/jonas/code/myproject.git When using SSH, remote repository addresses can be expressed in two ways. One using absolute paths and one using relative paths from the users home directory. You’ve mixed them up. The corrected command would be one of the following. git remote add origin jonas@192.168.1.10:code/myproject.git git remote add origin ssh://jonas@192.168.1.10/home/jonas/code/myproject.git

How to connect to a remote Git repository?

It’s simple and follow the small Steps to proceed: Install git on the remote server say some ec2 instance Now create a project folder `$mkdir project.git $cd project and execute $git init –bare Let’s say this project.git folder is present at your ip with address inside home_folder/workspace/project.git, forex- ec2 – /home/ubuntu/workspace/project.git Now in your local …

Read more

When doing a ‘git push’, what does ‘–set-upstream’ do?

To avoid confusion, recent versions of git deprecate this somewhat ambiguous –set-upstream option in favor of a more verbose –set-upstream-to option with identical syntax and behavior. [ Reference ] git branch –set-upstream-to <remote-branch> sets the default remote branch for the current local branch. Any future git pull command (with the current local branch checked-out), will …

Read more

Git push to live server

Yes you can push directly to your webserver, but I wouldn’t recommend it since you should only push to repositories cloned with the –bare argument. I’d utilize the Git hook system to let the main repository automatically update the repo on the web server. Check out the post-update hook in: http://git-scm.com/docs/githooks This script could in …

Read more