GIT repo with trunk code: Difference between revisions

From Scribus Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 15: Line 15:
Add trunk.git as second remote repo:
Add trunk.git as second remote repo:
<source lang="bash">#git remote add -f -m master trunk git://scribus.net/trunk.git</source>
<source lang="bash">#git remote add -f -m master trunk git://scribus.net/trunk.git</source>
Pull from trunk:
Pull from trunk (svn branch is in sync):
<source lang="bash">#git pull trunk HEAD</source>
<source lang="bash">#git pull trunk svn</source>
After any local changes and committing push them to remote branch:
After any local changes and committing push them to remote branch:
<source lang="bash">#git push my_branch origin</source>
<source lang="bash">#git push my_branch origin</source>
Line 26: Line 26:
Next you must push new branch into remote repo:
Next you must push new branch into remote repo:
<source lang="bash">#git push -u origin new_branch</source>
<source lang="bash">#git push -u origin new_branch</source>
===After pull/fetch from trunk===
===After pull/fetch from trunk===
Sometimes after merging current state of trunk into my local repo diff starts to show some files which I not touch. In that case helps this command applied for some file (or with * in problematic directory - be careful with your changes - you can lost it with *)
Sometimes after merging current state of trunk into my local repo diff starts to show some files which I not touch. In that case helps this command applied for problematic files (or with * in problematic directory - be careful with your changes as you can lost them!):
<source lang="bash">#git checkout trunk/master -- file</source>
<source lang="bash">#git checkout trunk/master -- path/file</source>
===Deleting branches===
To deleting remote branch:
<source lang="bash">#git push origin :branch2delete</source>
To deleting local branch:
<source lang="bash">#git branch -d branch2delete</source>
===Update list of remotes branches===
If someone delete its own branch on remote repo, then only his local repo knows about it.
Others should in that case update their branches list by command:
<source lang="bash">#git remote prune origin</source>

Latest revision as of 09:49, 6 August 2012


This page provides documentation for the successful usage of Scribus Git repositories for Scribus development.
After this set of commands you will have your own branch in local folder and in scribus.git repository but based on current trunk.git repository image.

Initialisation of local GIT repo:

#git init

Add scribus.git as remote repo:

#git remote add -f origin git@scribus.net:scribus.git

Creating local branch:

#git branch --track my_branch origin/master
#git checkout my_branch

Add trunk.git as second remote repo:

#git remote add -f -m master trunk git://scribus.net/trunk.git

Pull from trunk (svn branch is in sync):

#git pull trunk svn

After any local changes and committing push them to remote branch:

#git push my_branch origin


You should pull changes from trunk often to keep your repo in sync. Be careful to not push your changes to repos which are not in sync with trunk and available for others for push (eg. origin/master).

Creating new remote branch

First you should create new local branch. You must be in your local repo directory.

#git checkout -b new_branch

Next you must push new branch into remote repo:

#git push -u origin new_branch

After pull/fetch from trunk

Sometimes after merging current state of trunk into my local repo diff starts to show some files which I not touch. In that case helps this command applied for problematic files (or with * in problematic directory - be careful with your changes as you can lost them!):

#git checkout trunk/master -- path/file

Deleting branches

To deleting remote branch:

#git push origin :branch2delete

To deleting local branch:

#git branch -d branch2delete

Update list of remotes branches

If someone delete its own branch on remote repo, then only his local repo knows about it. Others should in that case update their branches list by command:

#git remote prune origin