Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6604417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:09:12+00:00 2026-05-25T19:09:12+00:00

For the last python project I developed, I used git as versioning system. Now

  • 0

For the last python project I developed, I used git as versioning system. Now it’s that time of the development cycle in which I should begin to ship out packages to the beta testers (in my case they would be .deb packages).

In order to build my packages I need a number of extra files (copyright, icon.xpm. setup.py, setup.cfg, stdeb.cfg, etc…) but I would like to keep them separate from the source of the program, as the source might be used to prepare packages for other platforms, and it would make no sense having those debian-specific files lingering around.

My question: is there a standard way/best practice to do so? In my google wanderings I stumbled a couple of times (including here on SO) on the git-buildpackage suite, but I am not sure this is what I am looking for, as it seems that is thought for packagers that download a tar.gz from an upstream repository.

I thought a possible way to achive what I want would be to have a branch on the git repository where I keep my packaging-files, but this branch should also be able to “see” the files on the master branch without me having every time to manually merge the master into the packaging branch. However:

  • I don’t know if this is a good idea / the way it should be done
  • Although I suspect it might involve some git symbolic-ref magic, I have no idea how to do what I imagined

Any help appreciated, thanks in advance for your time!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:09:13+00:00Added an answer on May 25, 2026 at 7:09 pm

    At the end I settled for a branch with a makefile in it, so that my packaging procedure now looks something like:

    git checkout debian-packaging
    make get-source
    make deb
    <copy-my-package-out-of-the-way-here>
    make reset
    

    If you are interested you can find the full makefile here (disclaimer: that is my first makefile ever, so it’s quite possible it’s not the best makefile you will ever see).

    In a nutshell, the core of the “trick” is in the get-source directive, and it is the use of the git archive command, that accepts the name of a branch as an argument and produces a tarball with the source from that branch. Here’s the snippet:

    # Fetch the source code from desired branch
    get-source:
        git archive $(SOURCE_BRANCH) -o $(SOURCE_BRANCH).tar
        tar xf $(SOURCE_BRANCH).tar
        rm $(SOURCE_BRANCH).tar
        @echo "The source code has been fetched."
    

    Hope this helps somebody else too!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP script which executes a shell command: $handle = popen('python last',
last time I asked how to populate a data structure here . Now I
I have been developing a project in python for the last six months, and
I have a python project that calls a c++ dll that calls a c#
I have a django (Python) project that needs to know what version its code
I created a simple python project that serves up a couple of pages. I'm
We're currently working on a python project that basically reads and writes M2M data
Last year, Scott Guthrie stated You can actually override the raw SQL that LINQ
Last time I asked about the reverse process , and got some very efficient
I am starting a little side project which consists of building a small-medium sized,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.