0
$\begingroup$

Rosanswers logo

I have a catkin workspace with the following structure:

catkin_ws/
├── build
├── devel
└── src

As expected all my code/packages are in the src directory but the base directory, catkin_ws, is being tracked by GIT.

My problem is that each time I have to execute catkin_make, git status reports back modifications to build and devel directories - which I want ignored.

I created a .gitignore file under catkin_ws with the following content:

# exclude everything except directory foo/bar

build/
devel/*

But, I still get the same modified files in build and devel as shown below:

> On branch master Changes not staged for commit:   (use "git add <file>..." to update what will be committed)   (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   .gitignore
        modified:   build/CMakeCache.txt
        modified:   build/CMakeFiles/Makefile.cmake
        modified:   build/CMakeFiles/Makefile2
        modified:   build/CMakeFiles/TargetDirectories.txt
        modified:   build/CTestTestfile.cmake
        modified:   build/Makefile
        modified:   build/catkin_generated/generate_cached_setup.py
        modified:   build/catkin_generated/installspace/_setup_util.py
        modified:   build/catkin_generated/order_packages.cmake
        modified:   build/catkin_generated/order_packages.py
        modified:   build/catkin_generated/setup_cached.sh
        modified:   build/catkin_generated/stamps/Project/_setup_util.py.stamp
        modified:   build/catkin_make.cache
        modified:   build/cmake_install.cmake
        modified:   devel/_setup_util.py

Untracked files:   (use "git add <file>..." to include in what will be committed)

        src/beginner_tutorial/
        src/my-robot/
        src/oreilly/

Can anyone help, please?


Originally posted by sisko on ROS Answers with karma: 247 on 2017-12-09

Post score: 0


Original comments

Comment by jayess on 2017-12-09:
If you have a collection of related packages you can create a metapackage that houses those related packages and put that under version control instead.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The proper way to approach this would be to not version your entire Catkin workspace, but just the packages / directories inside the source space.

See #q264600, #q216664 and #q257855 for some older questions and answers about this.


Originally posted by gvdhoorn with karma: 86574 on 2017-12-09

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by sisko on 2017-12-09:
I think you are right.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.