In my setup I have three repos:
- A bare repo on remote server (
/op/git/proj.git
) - A non-bare repo on remote server (
/var/www/proj/.git
) - A non-bare repo on local machine (
/var/www/proj/.git
)
The bare repo is origin to both ordinary repos on local and remote.
Whenever I do a commit on local, I do a local push
to bare repo and then pull
on ordinary remote repo and I get my changes on remote.
Now, I want to merge
branch A
to master
which method should I use? (Assume master
is the current branch on both repos)
Method 1
1. local$ git merge A
2. local$ git push origin master
3. remote$ git pull origin master
Method 2
1. local$ git merge A
2. remote$ git merge A
I am not sure if the second method is all I need to do or not, in other words, since you cannot do things like checkout
and merge
in a bare repo, do you need to do anything to the bare repo after a merge
?