How do I fix missing git remote details?

Some repository clones I have allow me to do this:

% git pull
% git push

But other repositories require me to type:

% git pull origin master
% git push origin master

I think I am missing something in the latter case - does anyone know what is (not) going on here? I am using the latest git version, just obviously not using it well.


If you cd into your repository directory and then open up your .git/config file in an editor.

Append this to the end of the file:

[branch "master"]
     remote = origin
     merge = refs/heads/master

This is pretty much just an alias so git knows by default to pull from origin master.

Or if you prefer, you can do the same thing Brian Gianforcaro proposed from the command line:

git config branch.master.remote origin
git config branch.master.merge  refs/heads/master

Also, to avoid having to do git push master, you can specify what branches to push in your Git config file, like so:

[remote "origin"]
        push = master

Need Your Help

Video encoding pipeline - threads design

multithreading encoding streaming video-capture video-processing

I work on a system which does video capture & encoding of multiple channels. each stage takes time. The capture/encoding is done in HW, but still can take its time to finish.

Mysql2 Unknown column 'individual' in 'field list'

mysql ruby-on-rails database rspec

I am writing Rspec tests, but they are failing because Mysql does not recognize the individual column the field list.