Github workshop using git bash & other tools...
- Install Git bash (if not already installed)
- Download URL: https://git-scm.com/downloads
- Answer all the questions during the installation process.
⚠️ Regarding theline-ending
settings, selectCheckout as-is, commit as-is
⚠️
- Download the Git cheat-sheet from here: git-cheat-sheet-education.pdf
- Git clone your fork in your local folder
- For this you will have to provide a login and password
- the login is your github login (email or username)
- the password is usually a token you created for a project/machine/OS/IP location (the token is not your github password)
- You should now have a local repository of this workshop repository
let's the fun begin. For this workshop we will use the Lua version of the HARFANG 3D engine to practice the usage of Git bash/Git VS Code.
- Download the HARFANG tutorials from here (as a zip file)
- Find the tutorial named
game_mouse_flight.lua
- Copy this Lua script into your local repository (at the root of the directory)
- Git add this new file
- Git commit
- A comment is mandatory
- Git push
- Go to your online repository on github.com and check the updated page
- Download the Lua release of HARFANG 3D for Windows64 from here: HG 3.2.7 Releases
- Deploy the binaries of Lua into a new directory of your local repository. A
bin/
directory should be fine - Copy the
resources
directory from the tutorials into your local repository - Git add theses new folders and files. Commit, comment, push.
- Go to your online repository on github.com and check the updated page
- Create a new .bat file to compile the
resources
using HARFANG'sassetc
command line (something likeassetc.exe ressources
)- Check the details of how assetc works here : https://dev.harfang3d.com/docs/3.2.7/man.assets/
- Test the .bat file
- Git add, commit, comment, push
- Create a new .bat file to run the
game_mouse_flight.lua
script (something likelua.exe game_mouse_flight.lua
) - Test the .bat file, the Lua program should run and open a window
- Git add, commit, comment, push
- Go to your online repository on github.com and check the updated page
Now let's use the branch feature!
When you create a commit in Git, the process works as follows:
- You're on branch
A
. - You make changes, add them to the staging area with
git add
, then create a commit withgit commit
. - This commit is now recorded on branch
A
. - If you now switch to another branch, let's call it
B
, usinggit checkout B
(orgit switch B
in newer versions), this commit remains on branchA
. The branchB
isn't aware of this commit unless you merge or move it in some manner. - Not doing a
git push
yet doesn't affect how commits are associated with branches locally.
If you want the commit to be present on branch B
, you'd have to merge branch A
into branch B
or use other methods like cherry-picking to specifically move that commit from one branch to another.
- Improve this readme
- Add a description of the mini game
- Add a screenshot of the mini game
- Git add, don't commit yet!
- Create a branch, call it
readme-update
- Git commit, push
- Go to your online repository on github.com and check the new branch
- Go to your online repository on github.com and check the updated page
- Let's merge
- Let's prepare a release :)