Here is the workflow I am aiming for:
I have two repositories. One for the website framework coded in PHP, and the other is for custom PHP code for added website features the client wants.
I need to be able to pull from both repositories for the client website but only push to one, which would be the custom code, and I only want that second repository to hold the custom code, not the framework.
How can I achieve this?
I have both repositories added but it always does a merge (because I use git pull
) but if I use just git remote update
my files are not changed.
Steps I took for the setup:
Remote:
mkdir ~/git/framework.git
cd ~/git/framework.git
git init --bare
mkdir ~/git/client1.git
cd ~/git/client1.git
git init --bare
Local:
mkdir ~/www/framework
cd ~/www/framework
git init
git remote add framework ssh://user@host/~/git/framework.git
mkdir ~/www/client1
cd ~/www/client1
git init
git remote add framework ssh://user@host/~/git/framework.git
git remote add client ssh://user@host/~/git/client1.git
Here is my local client config:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "framework"]
url = ssh://user@host/~/git/framework.git
fetch = +refs/heads/*:refs/remotes/framework/*
[remote "client"]
url = ssh://user@host/~/git/client1.git
fetch = +refs/heads/*:refs/remotes/client/*