Upload
bedis-elacheche
View
104
Download
0
Embed Size (px)
Citation preview
Version control software
- Allows to work on several versions of the same project.
- Manages file sharing for concurrent development.
- Automatically merges changes into original files.
- Allows those changes to be distributed and used by all participants.
- Keeps track of changes with version control.
- You can always revert any file to a previous version.
- You can inspect the differences between any two versions of a file.
Why should I use a VCS?
As a single developer :
- Backing up versions of projects, rapid and stable releases of code updates.
- You don’t need to keep each iteration of your project on your computer.
- You can re-download any previous version at anytime.
As a team :
- It makes collaboration easier.
- There is no extra set-up required to access your work.
- Others can easily update the repository and use your code/source.
SVN: Repository structure: Trunk
- Usually meant to be the base of a project on which development progresses.
- Always contains the latest cutting-edge version of the project.
- May also be the most unstable version.
SVN: Repository structure: Branches
- A copy of code derived from a certain point in the trunk.
- A line of development that exists independently of another line.
- Used for applying major changes to the code while preserving the integrity of the code in the trunk.
SVN: Repository structure: Tags
- A “snapshot” in time on the trunk or a branch that you wish to preserve.
- Allowing you to go back and reproduce any bugs if necessary in a past version, or re-release a past version exactly as it was.
- Either a major release of the software, or the most stable point of the software before major revisions on the trunk were applied.
SVN: How to use it?
- Checkout working copy into target folder :$ svn checkout "/path/to/repository" "/path/to/folder"- Checkout working copy into current folder :$ svn co "/path/to/repository"
- Update path :$ svn update "/path"- Update path to revision 9 :$ svn up -r9 "/path"
- Add all items, recursively :$ svn add *- Add itemname (if folder, adds recursively)$ svn add itemname
SVN: How to use it?
- Delete path :$ svn delete "/path"
- Copy source to target :$ svn copy "/source" "/target"
- Move source to target :$ svn move "/source" "/target"
- Revert changes to path :$ svn revert "/path"
- Differences Between Files$ svn diff -r 2:7 "/path/file"
SVN: How to use it?
- Apply diff between revisions 2 and 7 of "item" to path:$ svn merge -r2:7 "item" "/path"
- Get path status :$ svn status "/path"$ svn st "/path"
- Resolve conflict :$ svn resolve "/path"
- Commit changes to path :$ svn commit "/path"$ svn ci -m "Message" "/path"
SVN: Further Considerations
- You must do an update (and resolve any possible conflicts) before you commit your copy.
- Make sure to update regularly otherwise you will have lots of conflicts.
- SVN will not help you if you do not commit regularly.
- If you add lots of new stuff, make sure to commit everyting.