Git workshop GDG Tlemcen
At some point of your development career, you will realize that git is not just a good skill to learn. But a must have for any developer.
I did this workshop in purpose of introducing Git to our Google Developer Group Tlemcen new members.
Here is what we covered so far:
- Brief Introduction of Git.
- Installing Git in different Operating Systems.
- Git Global configuration.
- Initializing repository.
- How to commit your changes.
- How to see and manage history.
What was not covered :
- Setting up your remote repository at (Github and Bitbucket) & (SSH Configuration)
- Fork & Pull requests
- GUI Git clients.
What we need to get started
- Code Editor Atom or Sublime Text
- Cup of coffee
Let’s Get Started
First thing to do after installing Git instructions Here.
- Git Global configuration:
- Initializing repository:
cd into you project folder. To initialize Git repository of your project just type the following command line:
- Commit changes:
For example i created a project folder named gittut initialize it and created an empty index.html file:
If you are using Windows you need to check Unix commands during Git Installation. For this command to work.
Then run this to get the list of the untracked files:
You will get something like this:
As you can see Git already gives you some useful information. Telling you that there is an untracked file index.html and to do what is called Staging you need to run the following:
Staging a file is like taking a snapshot of it. To learn more about this concept Here
Now that we added our new file to the Staging Area we just run a commit so it can be saved permanently in .git/ directory.
- Time travelling
To see the history of your commits just run the following:
You will get something like this
Please note that there is other combinations, for logging history Here
To be continued …
A very special thanks for all the GDG Tlemcen Team. For giving me the opportunity to do this workshop.