2. GIT
“GIT adalah perangkat lunak pengontrol versi atau proyek
manajemen kode perangkat lunak”
https://id.wikipedia.org/wiki/Git
Version Control System (VCS)
STACKIT Community
3. Illustration
File
Using GIT
Rev 1 Rev 2 Rev 3 Rev 4 Rev 5 Rev N
File
Without GIT
Ver 1 Ver 2 Ver 3 Ver 3 Ver 4 Ver 5
STACKIT Community
4. Development of GIT
Linus Torvalds
STACKIT Community
Born December 28, 1969
Helsinki, Finland
Accopation Software Engineer
5. HISTORY
Git development began in April 2005, after many developers of the Linux kernel gave up access to BitKeeper, a
proprietary source-control management (SCM) system that they had formerly used to maintain the project. The
copyright holder of BitKeeper, Larry McVoy, had withdrawn free use of the product after claiming that Andrew
Tridgell had created SourcePuller by reverse engineering the BitKeeper protocols.
Linus Torvalds wanted a distributed system that he could use like BitKeeper, but none of the available free
systems met his needs. Torvalds cited an example of a source-control management system needing 30 seconds
to apply a patch and update all associated metadata, and noted that this would not scale to the needs of Linux
kernel development, where synchronizing with fellow maintainers could require 250 such actions at once. For his
design criteria, he specified that patching should take no more than three seconds, and added three more points:
STACKIT Community
7. List of Topics
● Installation
● Creating and getting repository
● Setting Username and Email
● Git workflow
● Add and Commit
● Learning about a command
● Browsing the history
● Working with remote
● Push
● Branch and Marge
STACKIT Community
9. Getting and Creating Project
git init
git clone <repository>
git clone <repository> <new_dir>
> git clone https://github.com/stackit/my-first-project
STACKIT Community
10. GIT Options
git : displays all git commands
--version : Prints the Git suite version that the git program came from.
--help : Prints the synopsis and a list of the most commonly used commands. If the option --all or -a is given then all
available commands are printed. If a Git command is named this option will bring up the manual page for that command.
STACKIT Community
11. Setting name & email
You need to set who you are *before* creating any commit. That will allows
commits to have the right author name and email associated to them.
STACKIT Community
12. ● Global identity
git config --global user.name ” Oliver Queen”
git config --global user.email “example@gmail.com”
● Single repository
git config user.name ”Oliver Queen”
git config user.email “example@gmail.com”
git config --list
STACKIT Community
16. Learning about a command
To get more information about git command – details about what command
does, use the –help option or the help command.
> git status --help
> git help status
Or simply
> git status -h
STACKIT Community
17. > git log
> git log -2
Browsing the history
● Regular git log
● Oneline log
STACKIT Community
> git log --oneline
you can assign an alias
> git config --global alias.lol "log --oneline”
> git lol
> git log [no-commit]
> git log
● Using commit number
> git log [file-name.extension]
> git log index.html
● Log in particular file
> git log --author=“author-name”
> git log --author=”stackit”
● Log author
22. git remote add <remote_name> <remote_url>
> git remote add origin https://github.com/stackit/gitfund.git
Working with remotes
● Create remote
● Check existing remote
STACKIT Community
-
List all the existing remotes associated with this repository:
> git remove
List all the existing remotes associated with this repository in detail
including the fetch and push URLs:
> git remote –verbose
Or simply
> git remote --v