3

I want to backup git repos using this SO answer: Backup a GitHub repository

git clone --mirror git://github.com/user/project.git
git fetch

The only difference is I am using git fetch instead of git remote update

Are there any drawback of the two commands? (from the complete backup point of view, e.g. backup all tags, branches)

Community
  • 1
  • 1
Howard
  • 19,215
  • 35
  • 112
  • 184
  • Check this one : http://stackoverflow.com/questions/1856499/differences-between-git-remote-update-and-fetch – Danstahr Jul 23 '13 at 14:33
  • @Danstahr, thanks, so assume my only remote is github, so both commands are the same? – Howard Jul 23 '13 at 15:38

1 Answers1

1

Basically, unless you setup a specific configuration, git remote updates runs a git fetch against all your remotes.

The man page states

update
Fetch updates for a named set of remotes in the repository as defined
by remotes.<group>. If a named group is not specified on the command 
line, the configuration parameter remotes.default will be used; if 
remotes.default is not defined, all remotes which do not have the 
configuration parameter remote.<name>.skipDefaultUpdate set to true 
will be updated. (See git-config[1]).

In your case, if you didn't define any remotes.<group> nor a remotes.default, and if your only remote is github, running git remote update or git fetch is completely equivalent.

Arialdo Martini
  • 4,427
  • 3
  • 31
  • 42