[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: git: pushing a branch to a remote git repository

On Sunday 01 Nov 2009, Micha wrote:
> I'm using a clone of a local git repository to backup the repository.
>  The problem is that it seems that when pushing changes, only master
>  is pushed to the remote repository instead of all the branches.
> Is it possible to push/pull branches into an existing repository and
>  make sure that a push updates everything including branches?
> Thanks

You can control what gets pushed via an entry in the .git/config file.
If you look at the snippet I include below of one of mine for a remote 
called publuc, you see that I am fetching everything, but pushing just a 
few branches back (those with the push lines) and renaming them in the 

If you make a "push" line with *:* as its contents, I think you will 
then cause all branches to get pushed to the remote repository (but be 
careful that might not be what you want, as all the branches you are 
playing with will get pushed as well).

[remote "public"]
	url = ssh://wol/home/alan/git/mbchat.git
	fetch = +refs/heads/*:refs/remotes/public/*
	push = master:master
	push = mb:melindasbackups
	push = old-test:old-mb

Alan Chandler

Reply to: