Home/Support/Support Forum/Building "hello world!" with Pycharm and git
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Building "hello world!" with Pycharm and git

0 votes
Hello everyone.

I am currently working with a few XBee3 (XB3-24Z8PT-J) for some UI + remote motor application.

Since I need to share my code with other colleagues we decided to use Github.

I have installed Python 3.8.2, PyCharm community 2020.1.1, git 2.26.2 an github desktop 2.5.0.

I already successfully build upload and test a few simple IO "blink LED" programs made by myself and now I want to make my motor driver control program, and keep it on github to share it with the colleagues.

I now have two basic XBee MicroPython Projects.

its a single line:
print("Hello World!")

The first one works, the second one is in a github repository folder and work in a very awkward way.

The thing is PyCharm is flashing the .gitignore file and the whole .git folder as if it was part of my single line "hello world!" program.

here the output:
Deploying application in selected XBee device (COM5 - 115200/8/N/1/N)...

Cleaning stored code... [OK]
Flashing file /build/.git/config (1/27)... [OK]
Flashing file /build/.git/description (2/27)... [OK]
Flashing file /build/.git/FETCH_HEAD (3/27)... [OK]
Flashing file /build/.git/HEAD (4/27)... [OK]
Flashing file /build/.git/hooks/applypatch-msg.sample (5/27)... [OK]
Flashing file /build/.git/hooks/commit-msg.sample (6/27)... [OK]
Flashing file /build/.git/hooks/fsmonitor-watchman.sample (7/27)... [OK]
Flashing file /build/.git/hooks/post-update.sample (8/27)... [OK]
Flashing file /build/.git/hooks/pre-applypatch.sample (9/27)... [OK]
Flashing file /build/.git/hooks/pre-commit.sample (10/27)... [OK]
Flashing file /build/.git/hooks/pre-push.sample (11/27)... [OK]
Flashing file /build/.git/hooks/pre-rebase.sample (12/27)... [OK]
Flashing file /build/.git/hooks/pre-receive.sample (13/27)... [OK]
Flashing file /build/.git/hooks/prepare-commit-msg.sample (14/27)... [OK]
Flashing file /build/.git/hooks/update.sample (15/27)... [OK]
Flashing file /build/.git/index (16/27)... [OK]
Flashing file /build/.git/info/exclude (17/27)... [OK]
Flashing file /build/.git/logs/HEAD (18/27)... [OK]
Flashing file /build/.git/logs/refs/heads/master (19/27)... [OK]
Flashing file /build/.git/logs/refs/remotes/origin/HEAD (20/27)... [OK]
Flashing file /build/.git/objects/pack/pack-1ca67c90bababd28dd80a9fa57e3873aeee26faa.idx (21/27)... [OK]
Flashing file /build/.git/objects/pack/pack-1ca67c90bababd28dd80a9fa57e3873aeee26faa.pack (22/27)... [OK]
Flashing file /build/.git/packed-refs (23/27)... [OK]
Flashing file /build/.git/refs/heads/master (24/27)... [OK]
Flashing file /build/.git/refs/remotes/origin/HEAD (25/27)... [OK]
Flashing file /build/.gitignore (26/27)... [OK]
Flashing file /build/main.mpy (27/27)... [OK]
Running application... [OK]

DEPLOY SUCCESSFUL


It takes forever and I dont want to fill the XBee's memory with all that git stuff.

Any idea how I tell pycharm not to flash all these files into the XBee??

Thanks in advance.
asked May 29 in Python by Antoine New to the Community (9 points)

Please log in or register to answer this question.

2 Answers

+2 votes
 
Best answer
This was quite complex for me to figure out:

File > Settings > Editor > File Types
In the bottom "Ignore files and folders" delete the ".git;" part of the string
press ok

File > Settings > Project: <name of project> > Project Structure
click on the now visible .git folder and select "Excluded"
in the bottom "Ignore files and folders" add ".gitignore"

it now builds nicely and flash only the main.py file.
answered Jun 2 by Antoine New to the Community (9 points)
selected Jun 3 by Antoine
+1 vote
All of these files are telling the XBee to reach out and try to download the files from GetHub. Not what you want to do. I believe what you want is found in the Help files of PyCharm at https://www.jetbrains.com/help/pycharm/2020.1/github.html?utm_campaign=PC&utm_content=2020.1&utm_medium=link&utm_source=product
answered Jun 1 by mvut Veteran of the Digi Community (12,791 points)
thank you kind sir let me take a look at your link
So I made a token for my github account but nothing has changed.

Whenever I "run" the project it makes a copy of my ".gitignore" file and "\.git" folder inside the "\build" folder, and flash all of the files on the XBee.

How can I customize the build rules, there must be something no?
...