development <<< git sytnax
- summary
- installation on UG
- setup
- setup repo
- clone repo
- summary
UG - ubuntu gnome (16.04)
OS - operation system (unix, windows, etc)
repo == repository(GitHub)/project(GitLab).
gui/GUI == graphical user interface.
VCS == version control system.
The easy way to create and work with repo is create it on web side, uses hoster web service gui + some instructions.
In time of create repo (GitHub way), click checkbox to add readme.md file, or add it after creating repo (GitLab way) uses special button.
Configure git for each repo separately.
Don't use --global key unnecessarily. This style prevent you from upload with wrong user.name and user.email.
if you want that git ignore for example folder export , add to .gitingnore file inside .git hidden folder syntax **/export , and git will ignore file or directory export anywhere into repo.
Weblink to .gitignore pattern description.
To stop tracking a file that is currently tracked, use terminal git rm --cached , Enter.
Visual Studio Code or vscode, or code (linux way) have prebuilded VCS, which can make beginner level manipulation with repositories/projects(uses internal GUI), cloned from GitHub/GitLab, uses web service GUI.
- installation on UG
-terminal sudo su , Enter
-enter the root password, Enter
-Now you have super user permissions inside terminal
-terminal apt-get update , Enter
-terminal apt-get install git -y , Enter (-y == answer yes to all prompts)
-terminal exit , Enter. Now you again have usual user permissions inside terminal
- setup
Line endings configuration.
If you use files, which have CRLF strings ending, then DON'T EXECUTE THESE COMMANDS, or, before upload repo changes uses git, you will be must recode all files with CRLF to LF for example uses, vscode. This not hard, but if you have few files. If you have thousand files this handmaded process will be kill you.
-terminal git config --global core.autocrlf input , Enter
-terminal git config --global core.safecrlf true , Enter
Windows syntax is different and can be found at this weblink
-terminal git config --global color.ui true , Enter. Coloring of output. Default auto. true false
-terminal git config --global submodule.recurse true , Enter. Description weblink
-terminal kate ~/.gitignore_global , Enter,
then addon into new file next text and save the file:
.directory
**/export
The file .directory - file which dolphin create that store folder view data from last session
The folder **/export - standart folder for store haxeflixel project compiling result files like apk, exe and environment
-terminal git config --global core.excludesfile '~/.gitignore_global' now git will always skip these files and folders(and subfolders) inside all repos
- setup repo
-open terminal into repo folder(hidden .git folder level)
-terminal git config user.name "Your Name" , Enter. Name which will be displayed with your commits
-terminal git config user.email youremail@example.com , Enter. Email which will be displayed with your commits
-terminal git config credential.helper "cache --timeout=86400" , Enter. Save password 24h(60*60*24 seconds) , or before OS rebooting.
Additional commands.
-terminal git config --list , Enter. Show confirugation info of repository (global + repo).
-terminal git config --unset credential.helper , Enter. Stop cashing of your repo password data.
-terminal git credential-cache exit , Enter. Clear the cash immediately, but continue collect and save new incoming password data(in case of credential.helper is used).
-terminal git config --unset-all user.name , Enter. Delete user name from repo configuration data.
-terminal git config --unset-all user.email , Enter. Delete user email from repo configuration data.
-terminal git config --add user.name "Your Name" , Enter. Add user name into repo configuration data.
-terminal git config user.name "Your Name" , Enter. Add user name into repo configuration data.
-terminal git config user.email youremail@example.com , Enter. Add user email into repo configuration data.
- clone repo
-open terminlal inside folder prepared for repo cloning
-terminal git clone -b 2.9.1 --recurse-submodules https://github.com/openfl/lime.git openfl_lime. Clone repo with submodules, with tag 2.9.1 version of this repo(in this case lime 2.9.1).
But if you set git config --global submodule.recurse true earlier, then git clone -b 2.9.1 https://github.com/openfl/lime.git openfl_lime must do same (not tested personally).
An openfl_lime is folder name , that will be used for cloning repo. If you inside target folder, just cut it from terminal syntax like this git clone -b 2.9.1 https://github.com/openfl/lime.git , and cloned repo will be placed inside target folder.