Up till now I've used version control for simple web-based projects that don't really have a compile stage. I've now forked a relatively large project that follows the standard "./configure; make; make install" pattern. I'm unsure about the proper workflow for this type of project.
What do I do with all the created files from the compile process?
git add .
If so, how do I cleanup now and then?Obviously this is something everybody who deals with compiled code faces, so I'm sure there's an accepted pattern, I just am not familiar with it yet.
Distributed version control systems help software development teams create strong workflows and hierarchies, with each developer pushing code changes to their own repository and maintainers setting a code review process to ensure only quality code merges into the main repository.
Version control enables multiple people to simultaneously work on a single project. Each person edits his or her own copy of the files and chooses when to share those changes with the rest of the team. Thus, temporary or partial edits by one person do not interfere with another person's work.
The types of VCS are: Local Version Control System. Centralized Version Control System. Distributed Version Control System.
I agree with ChrisF, don't store binaries generated by the build in your repository. Your goal should be to have a nice .gitignore file, so that at any time running git status
should show no "untracked files". That means git is either ignoring or tracking all files.
One procedure I use to build my .gitignore is this:
add and commit all source to project (before anything was built)
cd project
git add .
git commit -m'initial import'
add simple patterns of files that will be ignored to .gitignore; this includes tings like *.o, *.so.
echo '*.o' > .gitignore
echo '*.so' >> .gitignore
then I run the build.
make
then I run
git ls-files -o >> .gitignore
which will pick up any outstanding files that are generated which you didn't specify with glob patterns.
-Bart
To clean up your working directory, you can use git clean
. It won't do any harm by default, unless you specify the -f
(force) flag.
The command line git clean -xfd
will delete everything in your working directory, that is not in version control.
Simple strategy is to store make output in another directory, e.g. build and then ignore this directory. You can configure it like this:
mkdir build && cd build && ../configure
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With