Everyone should use Git and GitHub?
Everyone should use Git and GitHub?
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/
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/
-
- Posts: 47
- Joined: 2024-09-28 09:28
Re: Everyone should use Git and GitHub?
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
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?
Will you normalize the coding of the end of line?
To LF or CRLF?
To LF or CRLF?
Re: Everyone should use Git and GitHub?
Don't you forget the: git add?
-
- Posts: 47
- Joined: 2024-09-28 09:28
Re: Everyone should use Git and GitHub?
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.
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?
commit -a ?
It looks dangerous
It looks dangerous
-
- Posts: 47
- Joined: 2024-09-28 09:28
Re: Everyone should use Git and GitHub?
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?
Interesting.
Actually, if i do a "git diff" before, i already see the list of the modified files.
Actually, if i do a "git diff" before, i already see the list of the modified files.
-
- Posts: 47
- Joined: 2024-09-28 09:28
Re: Everyone should use Git and GitHub?
You can see list of the files you have modified by typing "git status".
Re: Everyone should use Git and GitHub?
Thanks.
I finally understand what happened.
To see the new commits I have to use the command:
git log upstream/master..HEAD
I finally understand what happened.
To see the new commits I have to use the command:
git log upstream/master..HEAD