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

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 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

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

Merge two remote branches in a Git repository

If you have remote-tracking branches set up locally, it’s as simple as: git checkout production git merge development git push origin production If you have not yet set up remote-tracking branches, you could do something like: git fetch origin git checkout production # or `git checkout -b production origin/production` if you haven’t set up production … 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

tech