How to fix missing git deleted data?

Some clones of the repository that I allowed me to do:

% git pull % git push 

But for other repositories I need to enter:

 % git pull origin master % git push origin master 

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

+11
git repository
Nov 23 '08 at 2:54
source share
3 answers

If you entered the directory into the repository, then open the .git / config file in the editor.

Add 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 the original.

+13
Nov 23 '08 at 2:59
source share

Or, if you want, you can do the same as suggested by Brian Gianforkaro from the command line:

 git config branch.master.remote origin git config branch.master.merge refs/heads/master 
+12
Nov 23 '08 at 7:29
source share

In addition, to avoid the need for git push master , you can specify which branches to insert into your Git configuration file, for example:

 [remote "origin"] ... push = master 
+6
Dec 28 '08 at 2:44
source share



All Articles