Page 1 of 1

Everyone should use Git and GitHub?

Posted: 2024-10-01 18:23
by seweli
It's just an introduction to the Git topic.
Both to share good Introduction for dummies and to debate if the Panlexia project should propose other way to contribute.

git - the simple guide
http://rogerdudler.github.io/git-guide/

Re: Everyone should use Git and GitHub?

Posted: 2024-10-04 09:14
by pandunia-guru
The source files of Panlexia are really are in GitHub at https://github.com/barumau/panlexia. All contents are text files, mostly dictionary files (.tsv) or program source code files (.py). They are easy to edit with any text editor or GitHub's own online editor, see https://docs.github.com/en/codespaces/t ... sed-editor.

Currently my own setup is WSL + VSCode (Windows Subsystem for Linux + Visual Studio Code). It's setup in 15 minutes for example by following the instructions in https://www.youtube.com/watch?v=CokQE8kxxHQ. It may look like wizardry for non-programmers but it's not hard. Then start WSL and type the following commands:
# Install Git version control system:
sudo apt-get install git
# Configure yourself as Git user
git config --global user.name "Your Name"
git config --global user.email "youremail@domain.com"
# Download Panlexia workspace to your system:
git clone https://github.com/barumau/panlexia.git
# Open Panlexia workspace in VSCode
code panlexia

From then on you can always start the workspace by typing only code panlexia.

After making changes you need to upload them to GitHub database. You can read a Git guide to understand it better, but here is a simple way to do it:
# Upload latest changes from GitHub
git pull
# Create branch for your changes
git checkout -b my_branch
# Make your changes in VSCode. See your changes by typing:
git diff
# Commit all (-a) your changes with a message (-m):
git commit -a -m "Describe my change"
# Upload your branch to GitHub
git push origin my_branch

Re: Everyone should use Git and GitHub?

Posted: 2024-10-16 00:01
by seweli
Will you normalize the coding of the end of line?
To LF or CRLF?

Re: Everyone should use Git and GitHub?

Posted: 2024-10-16 00:13
by seweli
Don't you forget the: git add?

Re: Everyone should use Git and GitHub?

Posted: 2024-10-16 09:30
by pandunia-guru
You can configure git to handle line endings. Alternatively you can run dos2unix.

Unfortunately I haven't normalized line endings in Panlexia files yet. They are what they are. :( Fortunately users are not expected to modify any files in the "data" directory. They will modify only language-specific files inside "dict".

You can specify changes with git add or you can commit all changed files with git commit -a.

Re: Everyone should use Git and GitHub?

Posted: 2024-10-17 11:41
by seweli
commit -a ?
It looks dangerous 😅

Re: Everyone should use Git and GitHub?

Posted: 2024-10-17 17:46
by pandunia-guru
seweli wrote: ↑2024-10-17 11:41 commit -a ?
It looks dangerous 😅
It commits only files that are in the Git repository, not any other files. Besides, you can always undo or modify your last commit before you have uploaded/pushed it to GitHub. :)

You can also commit individual files like this:
git commit -m "Describe my changes" file1.tsv file2.py

Re: Everyone should use Git and GitHub?

Posted: 2024-10-18 01:28
by seweli
Interesting.
Actually, if i do a "git diff" before, i already see the list of the modified files.
Image

Re: Everyone should use Git and GitHub?

Posted: 2024-11-01 09:52
by pandunia-guru
You can see list of the files you have modified by typing "git status".

Re: Everyone should use Git and GitHub?

Posted: 2024-11-03 18:07
by seweli
Thanks.

I finally understand what happened.

To see the new commits I have to use the command:

git log upstream/master..HEAD