Assign a remote for Git Push

I've been developing in a local repository for a while and just set up a git server.

In the past, when the remote repo already exists, I can do a git clone, and then future git push just works -- it seems to be associated with the remote that git clone retrieved.

Since I want to push all my existing work to this fresh remote, I did a git remote add foo. But git push still doesn't work, I have to do a git push foo master.

How can I make foo master be the default so that git push works on it's own? And secondly, did I approach this in the right way? How would you populate a new remote repo with an existing local repo?

Answers


If you want git push to push to a remote without any additional parameters, rename that remote from foo to origin.


Need Your Help

Rails paperclip image save

ruby-on-rails imagemagick paperclip exif

When using paperclip, if i try to enter the url like so (in a create function after a picture saves

How do I change the name property of a <select> depending on which <option> is chosen in another <select>?

javascript forms select

I'm making a make/model form, with two dropdowns. When a make is selected, the model dropdown with the appropriate list of models for that make is shown and the rest of the dropdowns for the other...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.