Reboot 772 Posted February 3, 2015 Share Posted February 3, 2015 Hello, welcome friends. Probably most of you have seen the old versions of game. In VERSION.txt , ceva despre trunk si despre lastmirage. What is trunk ? The trunk is the main line of development in a SVN repository. A branch is a side-line of development created to make larger, experimental or disrupting work without annoying users of the trunk version. Also, branches can be used to create development lines for multiple versions of the same product, like having a place to backport bugfixes into a stable release. Finally, tags are markers to highlight notable revisions in the history of the repository, usually things like "this was released as 1.0". More info about trunk ? Subversion (SVN) is a popular tool used by many development teams as their primary way of versioning their code. Here are some of the basics to SVN. Possibly one of SVN's best aspects is the ability to work on a shared code base. This shared code base is called theTrunk. This is typically where the full, buildable code resides. It may depend on your team, but this code may be the code you work on daily and commit to. This leads into the idea of commits and updates. To illustrate this, let's imagine that you started a small project and had a decent amount of code developed by yourself. Recently, you've added members to your team and need to provide that code as the shared base (the Trunk). You've got yourself a server and through the advances in technology have SVN pre-installed and waiting to grab your code. After opening up your IDE of choice, you would create a Trunk based of the code you have on your machine. The code you have on your harddrive that is not shared is called your Local Version, or Working Version. SVN happily creates a Trunk and is ready to give your team the base code. Now, your team will perform an Update to grab the latest version of the code. An Updatewill bring the latest code from the repository to your Local Version. After that point, your team is able to work on their code on their own machines and work on different parts of the project. Each person will work on different files and have to submit their changes to the Trunk to create a new, updated version of the code base. ToCommit, is the process of uploading your local changes to the code base to use the newly written code. When you created the trunk, you Commited your local 'changes' (the change was from nothing to your project) to the Trunk. Commits and Updates are wonderful, but lead to a major issue. Let's assume two team members are working on the same file, HelloWorld.txt. Both team members come into work and grab the latest copy of that file within minutes and begin working on it. Team Member 1 types the words 'I Love SVN!' into the file and Commits the file. Meanwhile, Team Member 2 types the words, 'SVN Rules!' into the file and tries to Commit the file. Suddenly we've hit a snag because Team Member 2 wants to put his changes into the base code but hasn't Updated since Team Member 1 commited his file. This problem of being 'out-of-sync' is resolved via a process known as a Merge. AMerge is when a developer looks at the changes to his/her Local Version of a file and the changes made to a Trunk file that hasn't been Updated on the Local Version, and fixes the synchronization issue by ammending the code to include both updates or one of the updates. Here are Team Member 2's possible merge solutions: Override and Update: In this case, the Local Version of the file is discarded and the Trunk code overwrites everything. HelloWorld.txt would contain the text 'I Love SVN!' from Team Member 1, but not the text 'SVN Rules!' from Team Member 2. Override and Commit: This is similar to Override and Update, but the Trunk code is overwritten with the Local Version. HelloWorld.txt would not contain the text 'I Love SVN!' from Team Member 1, but would contain the text 'SVN Rules!' from Team Member 2. Merge Changes: In this solution, both changes are merged into Team Member 2's Local Version and (s)he is able to commit the file and overwrite the Trunk file. HelloWorld.txt would contain both pieces of text from Team Member 1 and Team Member 2. During the process of Commiting, Updating, and Merging, the code base can change quite drastically. As they teach in most computer classes, backing up your data is key to continuing a project without major losses. SVN handily provides a way to backup your code via Tags. A Tag is a snapshot of your code at a given time. It is similar to a Trunk but it is assumed a Tag will not change in the future. This is useful if a situation arises where it is necessary to revert your code base to a prior state. In larger environments, Tags are created with each build. Many projects typically require temporary code written during development in order to test specific issues without a fully functioning product. Here's an example, assume that project we talked about earlier needs to test a function that calculates the amount of times a number can be divided by 2. In the final product, that value will be provided by an external system, but currently this system is not implemented. The plan is to develop a temporary text field that will accept a value and run the function. In the final product, there will be only a label with the value in it, not a text box. From what we've been told about SVN up to this point, we would go into the base code, insert our temporary field, and test the function. This is somewhat practical with a single field, but now let's assume there are 100 fields like this. Obviously, it would be a massive headache to Update, write the changes, Commit, and in the future have to Update, revert the changes, and Commit. Sure you could use a Tag, but why create a backup of code that is temporary? Introducing Branches, a seperate Trunk-style project used for work on a project similar to this. If this team hires a new developer and wants to slowly introduce him to the project but doesn't want him developing on the Trunk, what can they do? Create a Branch for him/her to work on! Branches can be created from existing code bases, including the Trunk and Tags. Even better, you can Merge between a Branch and the Trunk to bring in changes from the temporary project that need to be implemented into the code base. This is a lot of information, and is really basic when talking about SVN, but very helpful when someone asks you, "Are we going to make a Tag of the Branch before Merging into the Trunk?" Now, go say that to everyone you meet and see if they know their SVN. Now Let's start to develop under subversion . Before you begin configuring the subversion you must install PKG. In FreeBSD console type: pkg After : Y -> ENTER ( to confirm install) After : pkg update Step 1. Install subversion with the command : pkg install devel/subversion Once you have installed the subversion through either of the methods, create a user for svn: pw groupadd svn; pw adduser svn -g svn -s /usr/sbin/nologin Create a home directory for all repository: mkdir -p /usr/home/svn/repos; chown -R svn:svn /usr/home/svn Add entries in /etc/rc.conf to run svnserve daemon on startup : echo 'svnserve_enable="YES"' >> /etc/rc.conf ; echo Now start the svnserve daemon either by : service svnserve start Step 2. pkg install apache24 echo 'apache24_enable="YES"' >> /etc/rc.conf Now open winscp and navigate to : /usr/local/etc/apache22/httpd.conf In httpd.conf looking for the following line: # ServerName www.yourdomain.com:80 And delete # from you httpd.conf (# ServerName www.yourdomain.com:80 ) Delete # service apache24 start Step 3. Open the file /usr/local/etc/apache24/httpd.conf and look for the following line: DirectoryIndex index.html And change like this DirectoryIndex index.html index.php Search in httpd.conf lines that start with new line AddType and start with these two: AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps Step 4. pkg install php5 pkg install php5-extensions cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini pkg install mod_php5 Step 5. pkg install devel/websvn Open : usr/local/www/websvn/include/config.php and add the following lines : $config->setSVNCommandPath('/usr/local/bin'); $config->addRepository('The SVN SERVER', 'file:///home/svn/repos/svntest/'); Then create /usr/local/etc/apache24/Includes/aliases.conf file with the following content: Alias /websvn "/usr/local/www/websvn" <Directory "/usr/local/www/websvn"> Options Indexes FollowSymLinks RewriteEngine on AllowOverride All Order allow,deny Allow from all </Directory> If you want to password protect your websvn directory also add: AuthType Basic AuthUserFile /usr/local/www/websvn/.htpasswd AuthName "Restricted Files" Require valid-user to previous <Directory ...> ... </Directory> section. And then create a .htpasswd file with command: htpasswd -c /usr/local/www/websvn/.htpasswd admin Then you will be abble to login using user admin and password you've just added. Then don't forget to restart Apache. Step 6. We will first create a subversion repository where our revisions will be placed : install -v -m 0755 -d /home/svn install -v -m 0755 -d /home/svn/repos svnadmin create --fs-type fsfs /home/svn/repos/my_first_project/ now : cd /home/svn/repositories/my_first_project/ Then: mkdir branches tags trunk Step 7. Start the svnserve server svnserve -d -r /home/svn/repositories/my_first_project Step 8. f you try to commit you might get an error regarding writting rights. In that case create a group for all your users and give chown to that group to your svn repository.To test a svn server from localhost (from the same machine) do a checkout of your svn server, then modify a file and do a commit..... put here example commands ....To access a svn repository from localhost use file:/// in front of your svn path.... put here example .... Step 9. Create /usr/local/etc/svnserve.conf file with the following content: [general] password-db = userfile realm = example realm anon-access = read auth-access = write [users] user = 12345 Here user is the username and 12345 is the password. With this settings authenticated users will have read/write privileges and anonymous users only read access. Next, navigate to : /usr/local/etc/rc.d and open file: svnserve In that file(svnserve), you find these lines: # Set some defaults svnserve_enable=${svnserve_enable:-"NO"} svnserve_flags=${svnserve_flags:-"-d --listen-port=3690 --listen-host 10.0.0.19"} svnserve_data=${svnserve_data:-"/home/svn/repos"} svnserve_user=${svnserve_user:-"svn"} svnserve_group=${svnserve_group:-"svn"} Where 10.0.0.19 is your SVN server IP, and /home/svn/repositories is the directory for your SVN repository. Then start the service with: /usr/local/etc/rc.d/svnserve start Step 10, You can connect to a SVN server from your command line (in Linux / BSD / OSX / Unix) or you can use TortoiseSVN and use from Windows.For using TortoiseSVN to connect to the SVN server see step 12. From command line you must first do a initial checkout with: svn checkout svn+ssh:// [email protected]/home/svn/repository/project After issuing a svn checkout command note that the local copy of SVN is in a folder, you must after checkout to change directory to that folder. And then commit to ssh with: svn commit If you want to use SSH on a nonstandard port you must configure subversion client locally to use other SSH port. To do that edit: edit ~/.subversion/config // on your local client machine and on section [tunnels] add (for example, asuming your ssh server is running on 2224): ssh2224 = /usr/bin/ssh -p 2224 Then do a checkout with ssh2224: svn checout svn+ssh2224:// [email protected]/home/svn/repository/project Step 11. Configure SSHd with keys To be able to login on SVN server without password you must configure SSH server to accept authentication without username/password, based on keys. A tutorial about configuring SSHd server to accept authentication on pair of private/public keys and not on username/password can be found here: Step 12. Using SVN with TortoiseSVN from a Windows station Remove path to putty from TortoiseSVN config, otherwise you will not be able to connect.It will still use putty. When you will connect to SVN server from TortoiseSVN use instead of hostname of SVN server a setting name you've saved in your putty for that server IP/Hostname to connect to.To connect to a SVN server from TortoiseSVN first do a checkout: svn+ssh:// [email protected]/home/svn/repository/project where: - 192.168.0.10 is your SVN server - user is your username on that server- /home/svn/repository/project - is your path to the project in the SVN server Step 13. SOON 6 Link to comment Share on other sites More sharing options...
ThePooter 4 Posted February 3, 2015 Share Posted February 3, 2015 nice thank you Link to comment Share on other sites More sharing options...
Krixius 13 Posted February 3, 2015 Share Posted February 3, 2015 nice how to. Thanks. pd: finish it! Regards Akroma Link to comment Share on other sites More sharing options...
Premium Cataclismo 86 Posted February 3, 2015 Premium Share Posted February 3, 2015 In VERSION.txt , ceva despre trunk si despre lastmirage. You forgot to translate this. Nice tutorial, btw. Also, I wonder... are you trying to prove something? Link to comment Share on other sites More sharing options...
Reboot 772 Posted February 3, 2015 Author Share Posted February 3, 2015 In VERSION.txt , ceva despre trunk si despre lastmirage. You forgot to translate this. Nice tutorial, btw. Also, I wonder... are you trying to prove something? Bagamias , sa-mi bag. Eram mort de somn. Acum ma apuc sa termin tot. You pull me one, I forgot to translate )) I was dead sleep when I start tutorial. 2 Link to comment Share on other sites More sharing options...
Premium Galet 514 Posted February 3, 2015 Premium Share Posted February 3, 2015 Wow, impatient to see more ! 1 Link to comment Share on other sites More sharing options...
Krixius 13 Posted February 9, 2015 Share Posted February 9, 2015 time for finish it¿ Link to comment Share on other sites More sharing options...
Reboot 772 Posted February 9, 2015 Author Share Posted February 9, 2015 Tutorial updated. I'll do other tutorials soon, now test to see if I missed something or if I'm wrong. You do tutions and about using Tortoise SVN. Tortoise svn client is that team members will use it. It is very hard to make this tutorial, there are many things to say and do not have time Link to comment Share on other sites More sharing options...
Alesta2 7 Posted February 16, 2015 Share Posted February 16, 2015 thank you Link to comment Share on other sites More sharing options...
ionutxp 72 Posted February 18, 2015 Share Posted February 18, 2015 Or you could simply use GIT which is sexier. You'll have bitbucket with provides free private repos, even github if you're a student. Link to comment Share on other sites More sharing options...
JachuPL 312 Posted February 18, 2015 Share Posted February 18, 2015 How to develop using git 1) Create account on bitbucket.org 2) Create repository 3) "pkg add git" on freebsd 4) Go to your repo and pick link that has ".git" at the end 5) "git clone repo_link" on freebsd, where repo_link is the link from 4) point 6) after you add files to this repo, write "git add -A" 7) git commit -m "this is a simple commit description" on freebsd 8) "git push" to send your updated repo to bitbucket.org 9) have fun the simplest developing process ever! Or you could simply use GIT which is sexier. You'll have bitbucket with provides free private repos, even github if you're a student. I haven't received a response from them since I requested student account in Oct 2014. Link to comment Share on other sites More sharing options...
Reboot 772 Posted February 18, 2015 Author Share Posted February 18, 2015 How to develop using git 1) Create account on bitbucket.org 2) Create repository 3) "pkg add git" on freebsd 4) Go to your repo and pick link that has ".git" at the end 5) "git clone repo_link" on freebsd, where repo_link is the link from 4) point 6) after you add files to this repo, write "git add -A" 7) git commit -m "this is a simple commit description" on freebsd 8) "git push" to send your updated repo to bitbucket.org 9) have fun the simplest developing process ever! Or you could simply use GIT which is sexier. You'll have bitbucket with provides free private repos, even github if you're a student. I haven't received a response from them since I requested student account in Oct 2014. Please do not compare subversion to GIT? Subversion is far superior. And I'll tell you why if you want. Link to comment Share on other sites More sharing options...
Premium Sanchez 2474 Posted February 18, 2015 Premium Share Posted February 18, 2015 It depends on your requirements but GIT have many more features than SVN, just like these: - You can create local commits - You can undo a merge - Git have a much better merge algorithm, once you're merging a huge project with thousands of files you'll understand what I'm talking about. ...and many more. Link to comment Share on other sites More sharing options...
ionutxp 72 Posted February 18, 2015 Share Posted February 18, 2015 How to develop using git 1) Create account on bitbucket.org 2) Create repository 3) "pkg add git" on freebsd 4) Go to your repo and pick link that has ".git" at the end 5) "git clone repo_link" on freebsd, where repo_link is the link from 4) point 6) after you add files to this repo, write "git add -A" 7) git commit -m "this is a simple commit description" on freebsd 8) "git push" to send your updated repo to bitbucket.org 9) have fun the simplest developing process ever! Or you could simply use GIT which is sexier. You'll have bitbucket with provides free private repos, even github if you're a student. I haven't received a response from them since I requested student account in Oct 2014. Please do not compare subversion to GIT? Subversion is far superior. And I'll tell you why if you want. Then, just tell us why is far superior. I like git because is very friendly with open-source or commercial projects that are made by a big number of contributors. Like Sanchez said it has a lot of useful features like local branches commits and the amount of control you can have with commit reverts / changing from one branch to another in the same directory almost instantly. It can suck only when you store huge binaries, but who does that? SVN will slowly die. Amen! Link to comment Share on other sites More sharing options...
Honorable Member martysama0134 7201 Posted February 18, 2015 Honorable Member Share Posted February 18, 2015 ^ One of the most important discussions about why git can't be compared with the other scm systems. Check out my GitHub Link to comment Share on other sites More sharing options...
JachuPL 312 Posted February 19, 2015 Share Posted February 19, 2015 How to develop using git 1) Create account on bitbucket.org 2) Create repository 3) "pkg add git" on freebsd 4) Go to your repo and pick link that has ".git" at the end 5) "git clone repo_link" on freebsd, where repo_link is the link from 4) point 6) after you add files to this repo, write "git add -A" 7) git commit -m "this is a simple commit description" on freebsd 8) "git push" to send your updated repo to bitbucket.org 9) have fun the simplest developing process ever! Or you could simply use GIT which is sexier. You'll have bitbucket with provides free private repos, even github if you're a student. I haven't received a response from them since I requested student account in Oct 2014. Please do not compare subversion to GIT? Subversion is far superior. And I'll tell you why if you want. Okay, tell me, I'm curious It depends on your requirements but GIT have many more features than SVN, just like these: - You can create local commits - You can undo a merge - Git have a much better merge algorithm, once you're merging a huge project with thousands of files you'll understand what I'm talking about. ...and many more. and of course simpler development process. I would die before finishing configuring svn And one more thing. I don't deny svn in any matter, I just say that - in my opinion - there is a way better tool. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now