What is Version Control?
Version control software keeps track of every modification to the code in a special kind of database. If a mistake is made, developers can turn back the clock and compare earlier versions of the code to help fix the mistake while minimizing disruption to all team members.
(read more...)
(read more...)
What is Git?
By far, the most widely used modern version control system in the world today is Git. Git is a mature, actively maintained open source project originally developed in 2005 by Linus Torvalds, the famous creator of the Linux operating system kernel.
(read more...)
(read more...)
What is a Repository?
In software development, a repository is a central file storage location. It is used by version control systems to store multiple versions of files. While a repository can be configured on a local machine for a single user, it is often stored on a server, which can be accessed by multiple users.
(read more...)
(read more...)
How do I get started?
First, you'll need to install Git for Windows.
Once installed, you can already start using it locally, but if you want to safely secure your files online, it's time now to choose an online repository.
There are many available options such as GitHub, GitLab or Bitbucket.
For this tutorial, we'll be rolling with GitLab, since it allows you to have free private repositories.
Once installed, you can already start using it locally, but if you want to safely secure your files online, it's time now to choose an online repository.
There are many available options such as GitHub, GitLab or Bitbucket.
For this tutorial, we'll be rolling with GitLab, since it allows you to have free private repositories.
How do I use Git on Windows?
Right-click you project's folder. Click "Git Bash here".
You are now using a Bash shell (Linux), on Windows. Pretty cool, eh?
Alright, back to the point!
To turn your project folder into a local git repository, simply type:
Now let's configure it. This is a one-time step. Check the video below at 12:30.
Time to make our first backup, or in Git lingo terms, our first "commit".
Quick video tutorial (skip to 7:22):
You are now using a Bash shell (Linux), on Windows. Pretty cool, eh?
Alright, back to the point!
To turn your project folder into a local git repository, simply type:
B4X:
git init
Time to make our first backup, or in Git lingo terms, our first "commit".
B4X:
git status
git add *
git status
git commit -m 'Yay!! My first commit!!! Woohooo!'
git status
gitk
'Note: The commands "git status" and "gitk" are not really necessary, as they're for visualization purposes only.
Quick video tutorial (skip to 7:22):
What is .gitignore and how to use it?
The file ".gitignore" (yes, it starts with a dot!) is a file you can create to ignore any files you decide not to be necessary in a backup.
This generally applies to the generated binaries.
Usage:
- Create an empty file named ".gitignore" in your project folder. You can use Notepad.
File content:
This generally applies to the generated binaries.
Usage:
- Create an empty file named ".gitignore" in your project folder. You can use Notepad.
File content:
B4X:
#Git will ignore the following files/folders:
bin/
gen/
src/
*.apk
*.dex
*b4a.meta
How does GitLab work?
Once you register your new account, you'll be presented with a quick-start guide.
If necessary, however, you may prefer to follow the instructions presented in this video:
If necessary, however, you may prefer to follow the instructions presented in this video:
How do I push my commit into the online repository?
First you'll need to add the remote repository, for example:
Then, it's as easy as:
Then, it's as easy as:
B4X:
git push origin master
Whaaaaaaat? This is too complicated!!!!!
Not really. Git can be a very complex system,
but only if you decide to really dive into it.
Stick with the basic commands and you'll be just fine.
TL;DR:
- Install Git for Windows and get an online repository.
- Git Bash on your project folder
- Create '.gitignore' if necessary
- Configure Git Bash to work with your online repo.
B4X:
git init
git config --global user.name 'Your Name'
git config --global user.email '[email protected]'
git remote add origin [email protected]:username/projectname.git
B4X:
git add *
git commit -m 'Your message here.'
git push origin master
Last edited: