Difference between revisions of "Git branch creation"

From relax wiki
Jump to navigation Jump to search
Line 16: Line 16:
  
 
=== Check out the branch ===
 
=== Check out the branch ===
 +
See also [[Git_installation | Git installation]] for tips and tricks.
 
<source lang="bash">
 
<source lang="bash">
 
# Catch which revision initiated the branch.
 
# Catch which revision initiated the branch.
Line 23: Line 24:
 
git svn clone -r $REV svn+ssh://$RUSER@svn.gna.org/svn/relax/branches/$BRANCH $BRANCH
 
git svn clone -r $REV svn+ssh://$RUSER@svn.gna.org/svn/relax/branches/$BRANCH $BRANCH
 
# Copy .gitignore from relax_trunk and add relax_commit standard message.
 
# Copy .gitignore from relax_trunk and add relax_commit standard message.
cd $BRACH
+
cd $BRANCH
 +
cp ../relax_trunk/.gitignore .</source>
 +
cp ../relax_trunk/relax_commit.txt .
 +
git config --add commit.template "relax_commit.txt"
  
 +
#Now check out the svn branch, which we will keep to perform certain svn commands.
 
</source>
 
</source>
 +
  
 
== See also ==
 
== See also ==
 
[[Category:git]]
 
[[Category:git]]

Revision as of 17:49, 18 May 2014

Links

http://www.nmr-relax.com/manual/Branches.html

Branch creation

http://www.nmr-relax.com/manual/Branch_creation.html

If a change is likely to be disruptive or cause breakages in the program, the use of your own temporary branch is recommended. This private branch is a complete copy of one of the main development lines wherein you can make changes without disrupting the other developers. Although called a private branch every change is visible to all other developers and each commit will result in an automatic email to the relax-commits mailing list. Other developers are even able to check out your branch and make modifications to it. Private branches can also be used for testing ideas. If the idea does not work the branch can be deleted from the repository (in reality the branch will always exist between the revision numbers of its creation and deletion and can always be resurrected). For example to create a branch from the main development line, the `trunk', called molmol_macros whereby new Molmol macros are to be written, type

bash
RUSER=xxx
BRANCH=disp_speed

svn cp svn+ssh://$RUSER@svn.gna.org/svn/relax/trunk svn+ssh://$RUSER@svn.gna.org/svn/relax/branches/$BRANCH

Check out the branch

See also Git installation for tips and tricks.

# Catch which revision initiated the branch.
SVNLOG=`svn log --stop-on-copy svn+ssh://$RUSER@svn.gna.org/svn/relax/branches/$BRANCH`
REV=`echo $SVNLOG | cut -d" " -f2 | cut -d"r" -f2`; echo $REV

git svn clone -r $REV svn+ssh://$RUSER@svn.gna.org/svn/relax/branches/$BRANCH $BRANCH
# Copy .gitignore from relax_trunk and add relax_commit standard message.
cd $BRANCH
cp ../relax_trunk/.gitignore .

cp ../relax_trunk/relax_commit.txt . git config --add commit.template "relax_commit.txt"

  1. Now check out the svn branch, which we will keep to perform certain svn commands.

</source>


See also