What should be done for a repo?

I am wondering what code / should usually be tied to a project repo (branches, not a master)?

Full features only? Is it erroneous / frowning to commit half the code?

+4
source share
10 answers

Everything you write / create should be versioned.

Things that you create (.class files, generated code) should not be present when checking control: make sure that all team members have the same compilers / generators.

In general, I would do it as often as possible, making sure that the perfect code really works (it compiles fine, all tests pass)

+4
source

If you are working with a team, a good general rule is that only the working code is attached to the repo. If you have tests, it should have tests, and all tests must pass (be GREEN).

How you deal with partially completed functions really depends on your team and how the code is used. In my projects, I try to make the code ready for production, so if there is a partial function, it is somehow "hidden" from the user interface. There are other commands that allow the repo to move a bit between releases. It really depends on the commands and release cycles.

It seems perfect to check for partially-filled code in your own thread. Affiliates are relatively cheap to build and maintain and provide a good backup mechanism.

+2
source

The only thing most people agree on is to commit often. If you do something stupid or have a hardware failure, all that has already been done is saving, everything else can be lost.

As for where to make a commitment, this is something you and your colleagues need to agree on. There are many different ways to do this, and you need to find one that suits your workflow.

For example, you could only use compiled / verified / any code for the trunk so that it is (almost) always used; everything else will go into function branches that only merge into the trunk when they are compiled / tested / whatever. Or you could agree that everyone would happily agree to the trunk (which would always be unstable) and separate stable branches. And I am sure that there are many other conventions that I cannot think of now.

+1
source

If you ask what requirements before you go to the "trunk", the answer depends on the workflow used.

Note also that the concept of "trunk" is not what is required to exist in Git repositories; you can, for example, have "master" (stable branch, well, you can cut it off), "maint" (service branch, only corrections are applied there) and "next" (development branch).

But suppose that 'master' (what you call trunk) is the only published branch . In the working section of the topic of the branch, you create a new separate branch for each (well, almost everyone: individual commit and fix changes can be applied directly to "master") and merge them into "master" when it is ready.

To summarize these (and other) answers:

  • put only finished work in 'master'
  • do not break assembly
  • commit in master should pass testuite
  • do not put the generated files under version control
+1
source

It all depends on how you want to work, but there is food for thought:

Way of work I prefer to have a connecting line and a release branch. Changes are made to the trunk and merged into the release branch as needed.

If you pass logical units of work to the trunk, you have a good basis for cherry to select specific versions (and, therefore, functions) in the release branch, and you also got a good history of your project in your trunk history. If you do everything because it is Friday afternoon, it can be difficult to allocate a coherent set of functions for your release branch (if you have one), and it is very difficult to write good commit comments.

But you need to balance this, often obliging you to protect your work and extract value from your working copy. Unstable development branches are ideal for this. Branches can be short-lived and integrated into the trunk at logical / functional points. They will not fine if you do it simply because it is 20 minutes from the moment of the last transaction, and the story with the branch is likely to be quite simple, and you will not care about individual details.

However, this only makes sense if you have a rather complicated development environment — if you’re unlikely to make certain changes since the release or manage multiple versions of the project at the same time, it may not be worth it.

+1
source

Fix everything that is necessary to create a project in its current state (and no more).

At least I carry out half the completed functions all the time, but even if half-filling, of course, should be working code that does not break and does not break the rest of the project.

0
source

In this repository, you must commit the source (or input) to generate the required output for this project. This is usually the source code, and the output is a kind of executable object.

You should not transfer output or intermediate data that is generated as part of any build step to the same repository as the source. You can archive the intermediate or final result in a separate controlled repository. Having intermediate files in the same repository as the source files creates the possibility of inconsistency and blurs the strict storage boundary of the source and only the true source in your source code management tool.

You should perform as often as you need a breakpoint, but you must integrate (push / merge) with any integration branch that other developers turn off when your changes do not harm them, either disrupting the assembly or the main functions of the project.

0
source

Everything that affects the project / product.

It costs a little to keep track of changes and pays good dividends when someone searches for some feature that existed in the earliest fogs of time.

Above my head, here is my list

  • Requirements documents
  • Design Documentation
  • IDE workspace definitions
  • Libraries
  • SQL
  • Source code and generated documentation
  • Test Data
  • Test cases
  • Test case results.
0
source

If the branches are local, then commit whenever you can, because you should be able to undo or change them before pushing them to the remote repository.

For remote branches shared between other people, only if unit tests do not interrupt the publication.

0
source

Many people answer this, but I’ll throw my hat in the ring anyway.

Short answer: commit as often as you want for the files you are editing and are not automatically generated.

The long answer is rephrased as a slightly different question. More appropriate for teams is the question of what should I push. Local commits are for you and should be used as such.

The question of what I should do is slightly different from what I should do. First of all, you should only press the working code, since your team defines the working code. Ideal code that passes the tests and compiles / runs without breaking. (No matter how it is defined as a complete set of functions). However, since Git is so free that it can rewrite history, you have a couple of options on how to push them to the central repository.

  • If you want the central repository to have a clean, less noisy commit log, you can crush the commits for a function with one click to by clicking on the remote repo. (note: this will only work when no one else pulls you).
  • If you don't care how noisy a commit journal is for your central repo, then just click on all the small commits you had and don't worry about it.
0
source

All Articles