[SOLVED] How to properly upload source code to GitHub/ transfer code between computers?



  • Hello,

    How can I upload my source code to GitHub in a way where developers can easily download it and run it through their Qt creators? Is there a special way to do it for Qt?

    Thanks!


  • Moderators

    It works the same way for any kind of files and repositories. No Qt-specific stuff is required. Just create an account on GitHub, add your SSH key, create a repo on github, and push your local repository to it - GitHub will give you all the necessary instructions.


  • Moderators

    Just remember never to include any .pro.user files, build Makefiles, or build objects to the repository - it should be clean, just the source code.



  • Why should I not include the .pro file? Isn't that necessary to compile the program?



  • sierdzio was saying about .pro.user files. These files are generated by qtcreator for each .pro file and keep the user specific setting for the project .



  • ok the .pro.user file is different than the .pro file that i occasionally need to modify? the .pro file should be uploaded but the .pro.user should not?

    out of curiosity, where are the .pro.user files located?

    Sorry for the dumb questions, I'm new to using GitHub and uploading a Qt project :/

    Thanks for all your help!



  • .pro file contains info about your project.
    .pro.user contains settings for your project on a particular computer.

    The settings includes Qt versions, directory locations, etc.

    .pro.user file is modified by qtcreator when you modify settings in the "Projects" tab.

    .pro.user is located in the same directory as .pro

    [EDIT]: You need to submit .pro file.


  • Lifetime Qt Champion

    The pro.user file is located in the same folder as the pro file. It's generated by Qt Creator. The most simple way to avoid committing/pushing unwanted files is to add a .gitignore file (the dot is mandatory) with

    @
    *.pro.user
    @

    inside so you won't have to worry about that file.

    IIRC, GitHub offers to generate that file for you so it will included sensible defaults.



  • Thank you for the help!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.