create an intermediary git repository

I want to install an intermidiary git repository and all my team members can make a commit and push in this repository.

When all team memebers finish all tasks, all committed changes in intermidiary repository must be delivered in the offcial git repository located in another server hosted in the internet.

  • Maven versioning in a git repository with Vincent Driessen's branching model
  • How to merge two sequential git repositories
  • How to write git commit messages for submodule updates?
  • How to customize the git commit-msg hook?
  • Can/should I fork my own github repo?
  • How to integrate Sublime Text with GitHub?
  • My question, is it possible to do this configuration? and how to do it?

  • GitHub:Enterprise post-receive hook
  • gitignore file not working properly
  • File changed on one branch changes on both branches
  • How do I securely store a .pem file when working with git-tracked heroku project?
  • Overwrite index file in /var/www with vcsrepo
  • Git rebase -i not in terminal / only works with sudo
  • 5 Solutions collect form web for “create an intermediary git repository”

    It is possible.

    You can setup a git server in one of your LAN computer by following the tutorial here or using tools like Gitolite. Once you have the local git repo ready, you can grant access to your team members.

    To sync your local server to the central server, setup one local copy with two remotes. Then you can simply git pull from local server to get the local changes and git push to the central server. You can schedule this task by using a passphrase-less key-pair to access both servers.

    More details on setting up multiple git remotes is available here

    If I understand you correctly, you would like to put initial changes to git repos A

    Once some point is reached ( a milestone, a date etc ) all the changes to repos A are taken and applied to repos B

    Most development teams do this with a single repos and branching

    However, it’s possible to have branches wherever you like.

    There is an example in the man page for the git remote command

    EXAMPLES
       ·   Add a new remote, fetch, and check out a branch from it
    
               $ git remote
               origin
               $ git branch -r
               origin/master
               $ git remote add linux-nfs git://linux-nfs.org/pub/linux/nfs-2.6.git
               $ git remote
               linux-nfs
               origin
               $ git fetch
               * refs/remotes/linux-nfs/master: storing branch 'master' ...
                 commit: bf81b46
               $ git branch -r
               origin/master
               linux-nfs/master
               $ git checkout -b nfs linux-nfs/master
    

    Your repos A could be like the linux-nfs in the above example. After doing this, git merge could be used to combine the two

    Yes you can, because as GIT is a Distributed Revision Control System. Any cloned repository might be used as an origin (destination) of other repositories.

    Let’s say you want to make a proxy repository for a “main” repository called main.git

    git clone --bare path_to_main_repo/main.git path_to_proxy_repo/proxy.git
    git clone path_to_proxy_repo/proxy.git path_to_working_repository/working_repository 
    

    You can then push from your working_repository to the proxy and from the proxy to your main repository.

    Keep in mind that when using GIT, any given repository may play the role of a mainTargeted / proxy / orAnythingElse repository.

    Suppose to work in a project. You just pull code from master, and open new branch:

    git pull origin master
    git checkout -b new-branch
    ...
    

    Now you can push your branch or just start to work in it before push some commit.

    ...
    git add .
    git commit -am 'I am pushing in bew-branch'
    ...
    git add .
    git commit -am 'I am pushing in bew-branch'
    ...
    

    You have some feature in your branch (no in master) You are the first developer that has worker in this branch so, … you can push it in origin.

    ...
    git push origin new-branch
    ...
    

    Now exists a branch called ‘origin/new-branch’ and all developers can pull from this branch. Now you continue to commit in your locasl branch:

    ...
    git add .
    git commit -am 'I am pushing in bew-branch'
    ...
    git add .
    git commit -am 'I am pushing in bew-branch'
    ...
    

    Other developer pushed some code and now you need to pull

    ...
    git pull origin master
    ...
        Fix merge
    ...
    git push origin new-branch
    ...
    

    And finally you can put all commit in master

    ...
    git checkout master
    git merge new-branch
    git push origin master
    

    The end.

    Try using bare repository (http://git-scm.com/book/ch4-2.html)

    Basically, you intiate a new git bare repo like

    git init --bare
    

    Add this repository to the remote for each of your developer using

    git add remote upstream_intermediate_bare path/to/bare/repo
    

    And then push your commit to the upstream bare repository using

    git push upstream_intermediate_bare branch_name
    

    Next, in your official git repo, add another remote

    git add remote downstream_intermediate_bare path/to/bare/repo
    git pull downstream_intermediate_bare branch_name
    

    Bare repositories are important for the common case of a remote repository used only as a push and pull source. Check this.

    Edit: Sample example

    cd ~/Desktop/test
    mkdir dev1
    mkdir official
    cd dev1 && git init && touch file && git add . && git commit -m "msg" && cd ..
    cd official && git init && cd ..
    git init --bare interim
    cd dev1 && git remote add upstream_intermediate_bare ../interim && cd ..
    cd official && git remote add downstream_intermediate_bare ../interim && cd ..
    cd dev1 && git push upstream_intermediate_bare master && cd ..
    cd official && git pull downstream_intermediate_bare master && cd ..
    

    So with the above example, the developer code is in directory dev1, he pushes to a bare repository inside within which you can’t do a pull or a push, you have to add add it in your remotes and operate upon it, and the official repo just pulls from the bare repository.

    Git Baby is a git and github fan, let's start git clone.