How to update bare repo from remote source using git

I have a repo which is a bare clone of github repo:

 git clone --bare git@github.com:PabloSerbo/maiden.git

Some developers clone this repo and click on it.

Another developer directly passed the github repository.

I would like to know how to get the changes in github back to the bare repo for other developers to pull.

I tried:

 git fetch origin

It seems like it turns out:

 remotes/origin/master

But I can not get the local head to have changes.

The closest question I can find is this:

How to update my bare repo?

This involves mirroring, but I would like to know if there is a way to achieve this without the need for mirroring.

+3
source share
3 answers

. , . github repo "github" remote. github .

git fetch github
git push origin github/yourbranchname:yourbranchname

, .

+4

:

git fetch origin master:master

git update-server-info (I am using http to access bare repository, not sure that it has sense if you use another type ot transport  )

master. ,

+1

, git remote update / . HEAD . , HEAD , .

marcgc@deb6marc:~/projs/8568/svn/mix3/mIST_SE.git$ git fetch geekisp
carnicer@login.geekisp.com password: 
remote: Counting objects: 19, done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 14 (delta 10), reused 0 (delta 0)
Unpacking objects: 100% (14/14), done.
From login.geekisp.com:marc/tecsidel/git/mix/mIST_SE
 * [new branch]      master     -> geekisp/master
marcgc@deb6marc:~/projs/8568/svn/mix3/mIST_SE.git$ git lol
* 835bede (geekisp/master) dont crash
* 6de0db7 v2.0.11
* 42336a0 rename PicSearchAlga to PicSearch
* 845728d goto with 2 pix instead of 3
* a08ca13 (HEAD, master) v2.0.10
* 51c984e v2.0.8 : show CC in report (bugfix)

HEAD master . , :

marcgc@deb6marc:~/projs/8568/svn/mix3/mIST_SE.git$ git remote update geekisp
Fetching geekisp
carnicer@login.geekisp.com password: 
marcgc@deb6marc:~/projs/8568/svn/mix3/mIST_SE.git$ git lol
* 835bede (HEAD, geekisp/master, master) dont crash
* 6de0db7 v2.0.11

refs (HEAD, master) .

EDIT/upgrade:

, . .

marc@ibm:~/tecsidel/git/mix2/mIST_SE.git$ git fetch geekisp
carnicer@login.geekisp.com password:
Fetching geekisp
remote: Counting objects: 20, done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 14 (delta 11), reused 0 (delta 0)
Unpacking objects: 100% (14/14), done.
From login.geekisp.com:marc/tecsidel/git/mix/mIST_SE
   835bede..4e2e92e  master     -> geekisp/master
marc@ibm:~/tecsidel/git/mix2/mIST_SE.git$ 
marc@ibm:~/tecsidel/git/mix2/mIST_SE.git$ git lol
* 4e2e92e (geekisp/master, geekisp/HEAD) best search type, finds something
* d16406a start to see search types for sweden
* 9809ccd v2.0.12
* 835bede dont crash
* 6de0db7 v2.0.11
* 42336a0 rename PicSearchAlga to PicSearch
* 845728d goto with 2 pix instead of 3
* a08ca13 (HEAD, master) v2.0.10
marc@ibm:~/tecsidel/git/mix2/mIST_SE.git$ 
marc@ibm:~/tecsidel/git/mix2/mIST_SE.git$ git remote update geekisp
carnicer@login.geekisp.com password:
Fetching geekisp
marc@ibm:~/tecsidel/git/mix2/mIST_SE.git$ 

I'm stuck here. Headgear and craftsman did not point to the last retainer as expected.

marc@ibm:~/tecsidel/git/mix2/mIST_SE.git$ git lol
* 4e2e92e (geekisp/master, geekisp/HEAD) best search type, finds something
* d16406a start to see search types for sweden
* 9809ccd v2.0.12
* 835bede dont crash
* 6de0db7 v2.0.11
* 42336a0 rename PicSearchAlga to PicSearch
* 845728d goto with 2 pix instead of 3
* a08ca13 (HEAD, master) v2.0.10

It looks like my solution didn't work. After googling, I found a solution.

It seems that the fetch command should also have refspec, like master: master in my case.

marc@ibm:~/tecsidel/git/mix2/mIST_SE.git$ git fetch geekisp master:master
carnicer@login.geekisp.com password:
From login.geekisp.com:marc/tecsidel/git/mix/mIST_SE
   a08ca13..4e2e92e  master     -> master
marc@ibm:~/tecsidel/git/mix2/mIST_SE.git$
marc@ibm:~/tecsidel/git/mix2/mIST_SE.git$ git lol
* 4e2e92e (HEAD, geekisp/master, geekisp/HEAD, master) best search type, finds somet
* d16406a start to see search types for sweden
* 9809ccd v2.0.12
* 835bede dont crash
* 6de0db7 v2.0.11
* 42336a0 rename PicSearchAlga to PicSearch
* 845728d goto with 2 pix instead of 3
* a08ca13 v2.0.10
* 51c984e v2.0.8 : show CC in report (bugfix)
marc@ibm:~/tecsidel/git/mix2/mIST_SE.git$

The way it is.

0
source

All Articles