How can I use version control in a more powerful way?

In most of my projects, individuals or groups, I believe that I use only version control to just pull the latest changes and publish my own code.

However, I know that there is much more to version control, which is with branches and other powerful functions that I do not use.

Can someone give me advice on using version control in a more powerful way?

The version control systems that I mainly talk about are SVN and Git.

+4
source share
6 answers

You can start here: Red Book

You create tags for things you released; you create branches for what you are working on, and you can potentially be wrong / unstable. Your trunk should be as stable as possible (the person who did not sound right).

+13
source

Master of merging and branching. What I find surprising in most cases of using version control is that 90% of the people using it don’t know how to use it to support two different branches, at the same time they use it as a linear version control system when checking for changes, The real power of version control lies in the fact that it allows you to effectively support two separate versions of the system at the same time, which is very convenient when you have to simultaneously maintain the production version and developed Downloading a new version of a piece of software, Learning how to use a tool like Subclipse (and the Eclipse plugin for Maven) or a tool like Git to merge changes between branches is what I want more people using Version Control to They knew how to do it.

+11
source

git ready contains many tips for using Git from beginner to advanced. See Also the git Wiki for all kinds of documentation and tips on how to use Git.

Here are a few things that are good to learn and not obvious.

Reorder a series of commits:

git rebase -i <base-rev> 

Find what commit broke your unit tests, in this case make check ; you can use any other command that could check for some specific build failure or error and exit with a non-zero status on failure:

 git bisect start HEAD <known good revision>; git bisect run make check 

Show useful information about the remote and its branches:

 git remote show <remote> 

And forking in Git is easiest:

 git checkout -b branch-name master # create a new branch, starting it at master git pull origin master # merge in changes from the master branch on origin server git checkout master; git merge branch-name # merge changes you made on the branch git branch -d branch-name # once you're done with the branch 

If you want to share the branch with others while working on it or redirect it to the server for backup:

 git checkout branch-name # assuming it already been created git push origin branch-name # push the branch to the origin server 
+8
source

Consider installing your build system in a version control system. The tool chain itself may deviate over time, and the creation of development machines becomes comically simple, not a test. I also found that testing versions or building artifacts makes you enter the automation discipline. Consider methods for storing other articles of your software (requirements, steps, etc.). If you have external tools, fight duplication with all your might. Consider documenting the assembly environment as part of the assembly system and facilitating it so that the monkey can load the extraction, assembly, packaging, advertising, testing, packaging, signing and deployment belt.

+4
source

I believe version control is incredibly useful for isolating and fixing complex bugs. In particular, by updating previous versions, I can find out when the problem was introduced, and then find out what changes were made between the two versions, and easily isolate the problem.

+2
source

All Articles