{"id":1714,"date":"2011-01-13T18:18:47","date_gmt":"2011-01-13T13:18:47","guid":{"rendered":"http:\/\/aasims.wordpress.com\/?p=1714"},"modified":"2025-04-29T18:03:01","modified_gmt":"2025-04-29T18:03:01","slug":"guidelines-for-using-code-repositories","status":"publish","type":"post","link":"https:\/\/aasimnaseem.com\/blog\/guidelines-for-using-code-repositories\/","title":{"rendered":"Guidelines for Using Code Repositories"},"content":{"rendered":"<div>Hello everyone;<\/div>\n<div>\n<p>Hope you are doing good at your desks;<a href=\"https:\/\/AasimNaseem.com\/wp-content\/uploads\/2011\/01\/while-cloud-computing-has-many-uses-in-business-it-is-not-a-security-cure-all-_16001084_800874468_0_0_14061754_300.jpg\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-3644 alignright\" src=\"https:\/\/AasimNaseem.com\/wp-content\/uploads\/2011\/01\/while-cloud-computing-has-many-uses-in-business-it-is-not-a-security-cure-all-_16001084_800874468_0_0_14061754_300.jpg\" alt=\"While-cloud-computing-has-many-uses-in-business--it-is-not-a-security-cure-all-_16001084_800874468_0_0_14061754_300\" width=\"300\" height=\"225\" \/><\/a><\/p>\n<p>Today im lil technical; Will talk about code repositories and their usages;\u00a0This is an essential checklist for playing with code repositories; Everyone need to follow this;<\/p>\n<\/div>\n<div>If I miss anything, or any point where you feel something need to describe more clearly,\u00a0kindly correct me;<\/div>\n<div>So lets starts;<\/div>\n<div><\/div>\n<div><!--more--><\/div>\n<div>\n<p><strong>What is\u00a0source code repository?<br \/>\n<\/strong>A source code repository is a place where large amounts of\u00a0<a title=\"Source code\" href=\"http:\/\/en.wikipedia.org\/wiki\/Source_code\">source code<\/a> are kept, either publicly or privately. They are often used by multi-developer projects to handle various versions and developers submitting various patches of code in an organized fashion. (definition\u00a0from wikipedia)<\/p>\n<p><strong>What is Checkout?<br \/>\n<\/strong>In svn or cvs, checkout means you get\/download code from repository to start your work; A copy of files download to your system for further changes;<\/p>\n<p><strong>What is commit\/checked-in<strong>?<\/strong><br \/>\n<\/strong>commit\/checked-in mean you are sending your contents\/changes to code repository; Your work will be available to others when they will checkout\/update from same code repository;<\/p>\n<p><strong>What is update<strong>?<\/strong><br \/>\n<\/strong>Update mean you synchronize your downloaded\/checkedout code with repository; Anyone else who has checked-in\/commit some changes in repository, those changes will be merged\/added to your copy of code base; Your changes will not be sent to code base until you commit\/checked-in them;<\/p>\n<div>So here we go; These\u00a0guidelines\u00a0will help you to use code repositories in best way while working individually or in a team;<\/div>\n<div><\/div>\n<div><strong>Before start of work; <\/strong><\/div>\n<div>\n<ul>\n<li>Always update your code before start of your work; Tts more important when you are working in a team, so \u00a0if anyone else has committed some code after your last update, you may have latest\/updated version of code to start your work;<\/li>\n<li>It will also prevent having so much conflicts while update\/commit at day end with bulk of code need to synchronize between you and code repository;<\/li>\n<\/ul>\n<\/div>\n<div><strong>When you have made your changes and ready to commit your code;<\/strong><\/div>\n<div>\n<ul>\n<li>Confirm that your changes are working fine at your machine;<\/li>\n<li>Update your code again, so that you may have latest code; (update once before starting your work and once when you are going to commit)<\/li>\n<li>If there are some conflicted files,\u00a0resolve\u00a0them very carefully; At any point if you are confuse, don&#8217;t made any assumption and instantly ask someone to help out; Its a very sensitive step and need much attention and care;<\/li>\n<li>Once you have updated code and conflicts has been resolved, build and run the application again; Confirm your changes and those areas where you resolved conflicts, and\/or have merged\/updated files;<\/li>\n<li>If you feel somethings isn&#8217;t going good (compile time error or application&#8217;s\u00a0behavior\u00a0isn&#8217;t proper in some scenario) ask your lead to verify, or discuss with your team member to resolve them; Its normally happen when you are working in team and some program logic conflicts between two developers when\u00a0code repository merge the codes; (it is one possible case, some other reasons might be there)<\/li>\n<\/ul>\n<\/div>\n<div><strong>When everything is good; its time to commit your code;<\/strong><\/div>\n<div>\n<ul>\n<li>Check the status of files you have; If there is some un-versioned files (those files which you added in your project manually like images, new classes etc) First add them in repository using add option;<\/li>\n<li>Once new files has been added to repository, commit your code using commit option; Make a habit of providing proper comments while commit; It will not only help you but others too to know what changes were made in a\u00a0specific\u00a0version; Sometimes we need to get old status of code (from some older revision) so in such situation comments helps alot to track the changes and status of code base;<\/li>\n<li>After commit check the the status of your code again using status command; There shouldn&#8217;t be any edited\/modified and newly added files need to commit; You code base should be clean and fully updated;<\/li>\n<\/ul>\n<\/div>\n<div>\n<div><strong>Important Note;<\/strong><\/div>\n<div>It is found that sometimes developers commit their code at day end; Its not a\u00a0recommended\u00a0practice at all; (atleast in my opinion). Always commit your code when you feel your code is in stable form after your changes; Keeping your changes till day end will\u00a0maximize \u00a0the chances of conflicts at time of update\/commit. It will take your lot of time to resolve them properly.<\/div>\n<div><\/div>\n<div>Remember<\/div>\n<div>\n<ul>\n<li>Before start of any change, update your code;<\/li>\n<li>As soon as you fix a bug or made such change that your code is in working stable form, commit that change; Don&#8217;t Keep your change till day end. Be Updated and let other too;<\/li>\n<\/ul>\n<\/div>\n<div>\n<p>Moreover, \u00a0it is common that different developer use same svn user to update\/commit their code; So in such situation, mention your name in svn comments at time of code commit so that it become more clear to know\u00a0<em>who<\/em> committed\u00a0<em>what<\/em> and\u00a0<em>when<\/em>;<\/p>\n<\/div>\n<div>\n<div>\n<p>Anyone who feels hesitation or fear while update\/commit code, keep copy of this checklist and make sure not to miss any point; Ask your peer or lead instantly incase you are confuse what to do next; I&#8217;m here too to clear any query regarding the repositories usage;<\/p>\n<\/div>\n<div>\n<p>Happy Development;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><img decoding=\"async\" src=\"http:\/\/s08.flagcounter.com\/count\/bQC\/bg=FFFFFF\/txt=000000\/border=FFFFFF\/columns=6\/maxflags=200\/viewers=0\/labels=1\/pageviews=1\/\" alt=\"free counters\" border=\"0\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello everyone; Hope you are doing good at your desks; Today im lil technical; Will talk about code repositories and their usages;\u00a0This is an essential checklist for playing with code repositories; Everyone need to follow this; If I miss anything, or any point where you feel something need to describe&#8230;<\/p>\n","protected":false},"author":1,"featured_media":5227,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1144],"tags":[263,274,275,276,277],"class_list":["post-1714","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-code-repositories","tag-checkout","tag-code-checkin","tag-code-commit","tag-code-repositories","tag-code-update"],"_links":{"self":[{"href":"https:\/\/aasimnaseem.com\/blog\/wp-json\/wp\/v2\/posts\/1714","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aasimnaseem.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aasimnaseem.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aasimnaseem.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aasimnaseem.com\/blog\/wp-json\/wp\/v2\/comments?post=1714"}],"version-history":[{"count":3,"href":"https:\/\/aasimnaseem.com\/blog\/wp-json\/wp\/v2\/posts\/1714\/revisions"}],"predecessor-version":[{"id":5228,"href":"https:\/\/aasimnaseem.com\/blog\/wp-json\/wp\/v2\/posts\/1714\/revisions\/5228"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/aasimnaseem.com\/blog\/wp-json\/wp\/v2\/media\/5227"}],"wp:attachment":[{"href":"https:\/\/aasimnaseem.com\/blog\/wp-json\/wp\/v2\/media?parent=1714"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aasimnaseem.com\/blog\/wp-json\/wp\/v2\/categories?post=1714"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aasimnaseem.com\/blog\/wp-json\/wp\/v2\/tags?post=1714"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}