FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 04-03-2012, 06:58 AM
"J. Bakshi"
 
Default How to create empty git with master / development branch ?

Dear list,

I need to create git repos on a remote server by the command executed on that server
through ssh as

` ` ` ` `
git --bare init project_name.git

` ` ` ` `

How can I also add the master branch, so that users don't need to
execute [ git push origin master ] ?

Thanks


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120403122832.408e0f3d@shiva.selfip.org">http://lists.debian.org/20120403122832.408e0f3d@shiva.selfip.org
 
Old 04-03-2012, 09:17 AM
Alan Chandler
 
Default How to create empty git with master / development branch ?

On 03/04/12 07:58, J. Bakshi wrote:

Dear list,

I need to create git repos on a remote server by the command executed on that server
through ssh as

` ` ` ` `
git --bare init project_name.git

` ` ` ` `

How can I also add the master branch, so that users don't need to
execute [ git push origin master ] ?

Thanks


I am not sure what you are trying to do, however, you seems to be
confusing what is at the server with what a client, who clones from it
is doing.


Having got a bare repository, you just push your existing local master
branch to it


git push (repository url) master:master

That is what creates the master branch.

People can clone from it and in that case, they will get an origin
branch that is mapped to this repositories master. I am not entirely
sure, but I think they get setup with data in their .git/config file
which allows them to just git push origin. If not you can easily add
"names" where to push stuff to using the git remote command.


For instance, I use

git push public

on some of my repositories to push my local changes to both git hub AND
a local repository (created just like you did) for my redmine instance
to access. the .git/config file has something like the following in it


[remote "public"]
url = github:akc42/MBBall.git
url = hweb:redmine/git/mbball.git
push = master:master
push = sqlite:sqlite

In this case I am pushing TWO branches to TWO repositories. github: and
hweb: are aliases for a more complicated URL that is set up inside
.ssh/config - which in turn has the following in it


Host hweb
HostName avalon.hartley-consultants.com
User www-data
IdentityFile ~/mydocs/PCinfo/keys/hartley-web/hartley_web
Host github
HostName github.com
User git
IdentityFile ~/mydocs/PCinfo/keys/github/github_ssh_access




--
Alan Chandler
http://www.chandlerfamily.org.uk


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4F7AC017.50704@chandlerfamily.org.uk">http://lists.debian.org/4F7AC017.50704@chandlerfamily.org.uk
 

Thread Tools




All times are GMT. The time now is 07:52 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org