Git Tutorial

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/git-tutorial/
PINTEREST
PINTEREST
INSTAGRAM

Hi today we will look popular source code control application named git. Git is gaining popularity in the open source community a lot of projects ranging from small to big choose to use git as a source code versioning.  There is a lot of scv in the wild but git have very different aspects against them and these makes it very powerful. We do not look to much details in this tutorial because of this is a tutorial bu look slightly some of mechanisms about git. Lets start working. By the way we assume that git is all ready installed on the system . My system is fedora_20_x64.

Lets install

[ismail@dev-fedora ~]$ sudo yum install git
Loaded plugins: langpacks, refresh-packagekit
Package git-1.9.3-2.fc20.x86_64 already installed and latest version
Nothing to do

Make new directory for testing purposes

[ismail@dev-fedora ~]$ mkdir git-test

[ismail@dev-fedora ~]$ cd git-test

Initialize new repository. We can create new repo for existing files/codes too  without any special

[ismail@dev-fedora git-test]$ git init
Initialized empty Git repository in /home/ismail/git-test/.git/

Create new c source and add some code into it
[ismail@dev-fedora git-test]$ vim main.c
[ismail@dev-fedora git-test]$ cat main.c
#include “stdio.h”

 

Look for git status.
[ismail@dev-fedora git-test]$ git status
On branch master

Initial commit

Untracked files:
(use “git add <file>…” to include in what will be committed)

main.c

nothing added to commit but untracked files present (use “git add” to track)
[ismail@dev-fedora git-test]$ git add main.c
[ismail@dev-fedora git-test]$ git status
On branch master

Initial commit

Changes to be committed:
(use “git rm –cached <file>…” to unstage)

new file: main.c

List configuration option that can be used by git
[ismail@dev-fedora git-test]$ git config –list
user.name=İsmail Baydan
user.email=ibaydan@gmail.com
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true

[ismail@dev-fedora git-test]$ git config user.name
İsmail Baydan
[ismail@dev-fedora git-test]$ git config user.name “İsmail Baydan”
[ismail@dev-fedora git-test]$ git config help
error: key does not contain a section: help
[ismail@dev-fedora git-test]$ git config –help
[ismail@dev-fedora git-test]$ git config core.editor vim
[ismail@dev-fedora git-test]$ git config core.editor
vim
[ismail@dev-fedora git-test]$ vim LICENCE
[ismail@dev-fedora git-test]$ cat LICENCE
This is my licence
[ismail@dev-fedora git-test]$ git status
On branch master

Initial commit

Changes to be committed:
(use “git rm –cached <file>…” to unstage)

new file: main.c

Untracked files:
(use “git add <file>…” to include in what will be committed)

LICENCE

[ismail@dev-fedora git-test]$ git add LICENCE
[ismail@dev-fedora git-test]$ cat “GIT CYCLE”
cat: GIT CYCLE: No such file or directory
[ismail@dev-fedora git-test]$ echo “GIT CYCLE”
GIT CYCLE
[ismail@dev-fedora git-test]$ git status -s
A LICENCE
A main.c
[ismail@dev-fedora git-test]$ git status
On branch master

Initial commit

Changes to be committed:
(use “git rm –cached <file>…” to unstage)

new file: LICENCE
new file: main.c

[ismail@dev-fedora git-test]$ echo “README” > README
[ismail@dev-fedora git-test]$ git status -s
A LICENCE
A main.c
?? README
[ismail@dev-fedora git-test]$ cat .gitignore
cat: .gitignore: No such file or directory
[ismail@dev-fedora git-test]$ echo “.[oa]” > .gitignore
[ismail@dev-fedora git-test]$ cat .gitignore
*.[oa]
[ismail@dev-fedora git-test]$ gcc main.c
[ismail@dev-fedora git-test]$ ls
a.out LICENCE main.c README
[ismail@dev-fedora git-test]$ echo “
.out” > .gitignore
[ismail@dev-fedora git-test]$ cat .gitignore
*.out
[ismail@dev-fedora git-test]$ git status
On branch master

Initial commit

Changes to be committed:
(use “git rm –cached <file>…” to unstage)

new file: LICENCE
new file: main.c

Untracked files:
(use “git add <file>…” to include in what will be committed)

.gitignore
README

[ismail@dev-fedora git-test]$ git add .gitignore
[ismail@dev-fedora git-test]$ git status
On branch master

Initial commit

Changes to be committed:
(use “git rm –cached <file>…” to unstage)

new file: .gitignore
new file: LICENCE
new file: main.c

Untracked files:
(use “git add <file>…” to include in what will be committed)

README

[ismail@dev-fedora git-test]$ git diff
[ismail@dev-fedora git-test]$ git diff –staged
diff –git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..f47cb20
— /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.out
diff –git a/LICENCE b/LICENCE
new file mode 100644
index 0000000..97c8d48
— /dev/null
+++ b/LICENCE
@@ -0,0 +1 @@
+This is my licence
diff –git a/main.c b/main.c
new file mode 100644
index 0000000..21b2892
— /dev/null
+++ b/main.c
@@ -0,0 +1,6 @@
+#include “stdio.h”
+
+int main(){
+ printf(“Selam”);
+ return 0;
+}
[ismail@dev-fedora git-test]$ git diff –cached
diff –git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..f47cb20
— /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+
.out
diff –git a/LICENCE b/LICENCE
new file mode 100644
index 0000000..97c8d48
— /dev/null
+++ b/LICENCE
@@ -0,0 +1 @@
+This is my licence
diff –git a/main.c b/main.c
new file mode 100644
index 0000000..21b2892
— /dev/null
+++ b/main.c
@@ -0,0 +1,6 @@
+#include “stdio.h”
+
+int main(){
+ printf(“Selam”);
+ return 0;
+}
[ismail@dev-fedora git-test]$ git commit
[master (root-commit) 70cc9cd] Startup
3 files changed, 8 insertions(+)
create mode 100644 .gitignore
create mode 100644 LICENCE
create mode 100644 main.c
[ismail@dev-fedora git-test]$ git status
On branch master
Untracked files:
(use “git add <file>…” to include in what will be committed)

README

nothing added to commit but untracked files present (use “git add” to track)
[ismail@dev-fedora git-test]$ git log
commit 70cc9cde1afcb56f0e2ef1022beefd6bec830262
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:50:33 2014 +0200

Startup
[ismail@dev-fedora git-test]$ git diff
[ismail@dev-fedora git-test]$ git add README
[ismail@dev-fedora git-test]$ git status
On branch master
Changes to be committed:
(use “git reset HEAD <file>…” to unstage)

new file: README

[ismail@dev-fedora git-test]$ git commit -m “Added README”
[master 0d2dbdd] Added README
1 file changed, 1 insertion(+)
create mode 100644 README
[ismail@dev-fedora git-test]$ git log
commit 0d2dbdd67e31086f02483cffb62313396cf46226
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:51:30 2014 +0200

Added README

commit 70cc9cde1afcb56f0e2ef1022beefd6bec830262
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:50:33 2014 +0200

LEARN MORE  Multiline Strings in Python

Startup
[ismail@dev-fedora git-test]$ vim README
[ismail@dev-fedora git-test]$ git status
On branch master
Changes not staged for commit:
(use “git add <file>…” to update what will be committed)
(use “git checkout — <file>…” to discard changes in working directory)

modified: README

no changes added to commit (use “git add” and/or “git commit -a”)
[ismail@dev-fedora git-test]$ git commit -a -m “README change”
[master 244d943] README change
1 file changed, 1 insertion(+)
[ismail@dev-fedora git-test]$ git log
commit 244d943e41df31afae125bdb3a4189ab7ba6a1da
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:52:27 2014 +0200

README change

commit 0d2dbdd67e31086f02483cffb62313396cf46226
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:51:30 2014 +0200

Added README

commit 70cc9cde1afcb56f0e2ef1022beefd6bec830262
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:50:33 2014 +0200

Startup
[ismail@dev-fedora git-test]$ git rm README
rm ‘README’
[ismail@dev-fedora git-test]$ git status
On branch master
Changes to be committed:
(use “git reset HEAD <file>…” to unstage)

deleted: README

[ismail@dev-fedora git-test]$ git commit -m”Removed README”
[master cf90186] Removed README
1 file changed, 2 deletions(-)
delete mode 100644 README
[ismail@dev-fedora git-test]$ git log
commit cf9018601170d903b29dd3ee12033190525571bd
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:53:45 2014 +0200

Removed README

commit 244d943e41df31afae125bdb3a4189ab7ba6a1da
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:52:27 2014 +0200

README change

commit 0d2dbdd67e31086f02483cffb62313396cf46226
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:51:30 2014 +0200

Added README

commit 70cc9cde1afcb56f0e2ef1022beefd6bec830262
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:50:33 2014 +0200

Startup
[ismail@dev-fedora git-test]$ git log -p
commit cf9018601170d903b29dd3ee12033190525571bd
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:53:45 2014 +0200

Removed README

diff –git a/README b/README
deleted file mode 100644
index 543b52d..0000000
— a/README
+++ /dev/null
@@ -1,2 +0,0 @@
-README
-README CHANGE

commit 244d943e41df31afae125bdb3a4189ab7ba6a1da
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:52:27 2014 +0200

README change

diff –git a/README b/README
index e845566..543b52d 100644
— a/README
+++ b/README
@@ -1 +1,2 @@
README
+README CHANGE

commit 0d2dbdd67e31086f02483cffb62313396cf46226
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:51:30 2014 +0200

Added README

diff –git a/README b/README
new file mode 100644
index 0000000..e845566
— /dev/null
+++ b/README
@@ -0,0 +1 @@
+README

commit 70cc9cde1afcb56f0e2ef1022beefd6bec830262
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:50:33 2014 +0200

Startup

diff –git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..f47cb20
— /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*.out
[ismail@dev-fedora git-test]$ git log -p -2
commit cf9018601170d903b29dd3ee12033190525571bd
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:53:45 2014 +0200

Removed README

diff –git a/README b/README
deleted file mode 100644
index 543b52d..0000000
— a/README
+++ /dev/null
@@ -1,2 +0,0 @@
-README
-README CHANGE

commit 244d943e41df31afae125bdb3a4189ab7ba6a1da
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:52:27 2014 +0200

README change

diff –git a/README b/README
index e845566..543b52d 100644
— a/README
+++ b/README
@@ -1 +1,2 @@
README
+README CHANGE
[ismail@dev-fedora git-test]$ git log –stat
commit cf9018601170d903b29dd3ee12033190525571bd
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:53:45 2014 +0200

Removed README

README | 2 —
1 file changed, 2 deletions(-)

commit 244d943e41df31afae125bdb3a4189ab7ba6a1da
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:52:27 2014 +0200

README change

README | 1 +
1 file changed, 1 insertion(+)

commit 0d2dbdd67e31086f02483cffb62313396cf46226
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:51:30 2014 +0200

Added README

README | 1 +
1 file changed, 1 insertion(+)

commit 70cc9cde1afcb56f0e2ef1022beefd6bec830262
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:50:33 2014 +0200

Startup

.gitignore | 1 +
LICENCE | 1 +
main.c | 6 ++++++
3 files changed, 8 insertions(+)
[ismail@dev-fedora git-test]$ git log –pretty=oneline
cf9018601170d903b29dd3ee12033190525571bd Removed README
244d943e41df31afae125bdb3a4189ab7ba6a1da README change
0d2dbdd67e31086f02483cffb62313396cf46226 Added README
70cc9cde1afcb56f0e2ef1022beefd6bec830262 Startup
[ismail@dev-fedora git-test]$ git log
commit cf9018601170d903b29dd3ee12033190525571bd
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:53:45 2014 +0200

Removed README

commit 244d943e41df31afae125bdb3a4189ab7ba6a1da
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:52:27 2014 +0200

README change

commit 0d2dbdd67e31086f02483cffb62313396cf46226
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:51:30 2014 +0200

Added README

commit 70cc9cde1afcb56f0e2ef1022beefd6bec830262
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:50:33 2014 +0200

Startup
[ismail@dev-fedora git-test]$ –pretty=format:”%h –

%an, %ar : %s”
bash: –pretty=format:%h: command not found…
[ismail@dev-fedora git-test]$ –pretty=format:”%h – %an, %ar : %s”
bash: –pretty=format:%h: command not found…
[ismail@dev-fedora git-test]$ git log –pretty=format:”%h – %an, %ar : %s”
cf90186 – İsmail Baydan, 15 minutes ago : Removed README
244d943 – İsmail Baydan, 16 minutes ago : README change
0d2dbdd – İsmail Baydan, 17 minutes ago : Added README
70cc9cd – İsmail Baydan, 18 minutes ago : Startup
[ismail@dev-fedora git-test]$ git log –pretty=format:”%h – %an, %ar : %s” –graph
* cf90186 – İsmail Baydan, 15 minutes ago : Removed README
* 244d943 – İsmail Baydan, 16 minutes ago : README change
* 0d2dbdd – İsmail Baydan, 17 minutes ago : Added README
* 70cc9cd – İsmail Baydan, 18 minutes ago : Startup
[ismail@dev-fedora git-test]$ git log –since=2.weeks
commit cf9018601170d903b29dd3ee12033190525571bd
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:53:45 2014 +0200

Removed README

commit 244d943e41df31afae125bdb3a4189ab7ba6a1da
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:52:27 2014 +0200

README change

commit 0d2dbdd67e31086f02483cffb62313396cf46226
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:51:30 2014 +0200

Added README

commit 70cc9cde1afcb56f0e2ef1022beefd6bec830262
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:50:33 2014 +0200

Startup
[ismail@dev-fedora git-test]$ git log -SREAD
commit cf9018601170d903b29dd3ee12033190525571bd
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:53:45 2014 +0200

Removed README

commit 244d943e41df31afae125bdb3a4189ab7ba6a1da
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:52:27 2014 +0200

README change

commit 0d2dbdd67e31086f02483cffb62313396cf46226
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:51:30 2014 +0200

Added README
[ismail@dev-fedora git-test]$ git log –grepRemov
fatal: unrecognized argument: –grepRemov
[ismail@dev-fedora git-test]$ git log –grep “Remov”
commit cf9018601170d903b29dd3ee12033190525571bd
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:53:45 2014 +0200

Removed README
[ismail@dev-fedora git-test]$ vim README2
[ismail@dev-fedora git-test]$ git add README2
[ismail@dev-fedora git-test]$ git commit –amend
[master 03e59f9] Removed README
2 files changed, 1 insertion(+), 2 deletions(-)
delete mode 100644 README
create mode 100644 README2
[ismail@dev-fedora git-test]$ git log
commit 03e59f9a3f6154dbb9c2cd75df92667b1e919aeb
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:53:45 2014 +0200

LEARN MORE  How To Sort Python Dictionary By Value?

Removed README

commit 244d943e41df31afae125bdb3a4189ab7ba6a1da
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:52:27 2014 +0200

README change

commit 0d2dbdd67e31086f02483cffb62313396cf46226
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:51:30 2014 +0200

Added README

commit 70cc9cde1afcb56f0e2ef1022beefd6bec830262
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:50:33 2014 +0200

Startup
[ismail@dev-fedora git-test]$ git log -p
commit 03e59f9a3f6154dbb9c2cd75df92667b1e919aeb
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:53:45 2014 +0200

Removed README

diff –git a/README b/README
deleted file mode 100644
index 543b52d..0000000
— a/README
+++ /dev/null
@@ -1,2 +0,0 @@
-README
-README CHANGE
diff –git a/README2 b/README2
new file mode 100644
index 0000000..1a06674
— /dev/null
+++ b/README2
@@ -0,0 +1 @@
+README2

commit 244d943e41df31afae125bdb3a4189ab7ba6a1da
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:52:27 2014 +0200

README change

diff –git a/README b/README
index e845566..543b52d 100644
— a/README
+++ b/README
@@ -1 +1,2 @@
README
+README CHANGE

commit 0d2dbdd67e31086f02483cffb62313396cf46226
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:51:30 2014 +0200

Added README

diff –git a/README b/README
new file mode 100644
index 0000000..e845566
— /dev/null
+++ b/README
@@ -0,0 +1 @@
+README

commit 70cc9cde1afcb56f0e2ef1022beefd6bec830262
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:50:33 2014 +0200

Startup

[ismail@dev-fedora git-test]$ git log -p -1
commit 03e59f9a3f6154dbb9c2cd75df92667b1e919aeb
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 02:53:45 2014 +0200

Removed README

diff –git a/README b/README
deleted file mode 100644
index 543b52d..0000000
— a/README
+++ /dev/null
@@ -1,2 +0,0 @@
-README
-README CHANGE
diff –git a/README2 b/README2
new file mode 100644
index 0000000..1a06674
— /dev/null
+++ b/README2
@@ -0,0 +1 @@
+README2
[ismail@dev-fedora git-test]$ vim README2
[ismail@dev-fedora git-test]$ git status
On branch master
Changes not staged for commit:
(use “git add <file>…” to update what will be committed)
(use “git checkout — <file>…” to discard changes in working directory)

modified: README2

no changes added to commit (use “git add” and/or “git commit -a”)
[ismail@dev-fedora git-test]$ git reest HEAD README2
git: ‘reest’ is not a git command. See ‘git –help’.

Did you mean this?
reset
[ismail@dev-fedora git-test]$ git reset HEAD README2
Unstaged changes after reset:
M README2
[ismail@dev-fedora git-test]$ git status
On branch master
Changes not staged for commit:
(use “git add <file>…” to update what will be committed)
(use “git checkout — <file>…” to discard changes in working directory)

modified: README2

no changes added to commit (use “git add” and/or “git commit -a”)
[ismail@dev-fedora git-test]$ cat README2
README2
Please reset
[ismail@dev-fedora git-test]$ git add README2
[ismail@dev-fedora git-test]$ git status
On branch master
Changes to be committed:
(use “git reset HEAD <file>…” to unstage)

modified: README2

[ismail@dev-fedora git-test]$ git reset HEAD README2
Unstaged changes after reset:
M README2
[ismail@dev-fedora git-test]$ git status
On branch master
Changes not staged for commit:
(use “git add <file>…” to update what will be committed)
(use “git checkout — <file>…” to discard changes in working directory)

modified: README2

no changes added to commit (use “git add” and/or “git commit -a”)
[ismail@dev-fedora git-test]$ cd ..
[ismail@dev-fedora ~]$ git clone https://github.com/schacon/ticgit
Cloning into ‘ticgit’…
remote: Counting objects: 1857, done.
remote: Total 1857 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (1857/1857), 374.35 KiB | 154.00 KiB/s, done.
Resolving deltas: 100% (772/772), done.
Checking connectivity… done.
[ismail@dev-fedora ~]$ cd ticgit/
[ismail@dev-fedora ticgit]$ git remote
origin
[ismail@dev-fedora ticgit]$ cd ..
[ismail@dev-fedora ~]$ cd git-test/
[ismail@dev-fedora git-test]$ git remote
[ismail@dev-fedora git-test]$ cd ..
[ismail@dev-fedora ~]$ ls
Desktop Documents dynamips file_mac gns3-gui libguestfs Music Public scrapy Templates Videos workspace
django_test Downloads elasticsearch git-test kpds3 linux Pictures qemu sqlalchemy ticgit WordPress zmap_scan.txt
[ismail@dev-fedora ~]$ cd file_mac/
[ismail@dev-fedora file_mac]$ git remote
origin
[ismail@dev-fedora file_mac]$ git remote -v
origin https://github.com/ibaydan/file_hash.git (fetch)
origin https://github.com/ibaydan/file_hash.git (push)
[ismail@dev-fedora file_mac]$ cd ..
[ismail@dev-fedora ~]$ cd
[ismail@dev-fedora ~]$ git clone file_mac
fatal: destination path ‘file_mac’ already exists and is not an empty directory.
[ismail@dev-fedora ~]$ git clone file_mac test
Cloning into ‘test’…
done.
[ismail@dev-fedora ~]$ cd test/
[ismail@dev-fedora test]$ git remote
origin
[ismail@dev-fedora test]$ git remote -v
origin /home/ismail/file_mac (fetch)
origin /home/ismail/file_mac (push)
[ismail@dev-fedora test]$ vim ../file_mac/
.git/ .gitignore hash_dumped lib.py main.py pycache/ README.md
[ismail@dev-fedora test]$ vim ../file_mac/README.md
[ismail@dev-fedora test]$ cd
[ismail@dev-fedora ~]$ cd file_mac/
[ismail@dev-fedora file_mac]$ git add README.md
[ismail@dev-fedora file_mac]$ git commit -m”New func”
[master b12dcd2] New func
1 file changed, 1 insertion(+)
[ismail@dev-fedora file_mac]$ cd ..
[ismail@dev-fedora ~]$ cd test/
[ismail@dev-fedora test]$ git fetch origin
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From /home/ismail/file_mac
fbbb8a5..b12dcd2 master -> origin/master
[ismail@dev-fedora test]$ ls
lib.py main.py README.md
[ismail@dev-fedora test]$ vim README.md
[ismail@dev-fedora test]$ git log
commit fbbb8a504c286364f7963c9873393a5ef9f9e85d
Merge: 288eab5 690e53c
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Sat Oct 11 07:36:10 2014 +0300

Merge branch ‘master’ of https://github.com/ibaydan/file_hash

commit 288eab5369cbb612a168fb918ccf3d1e819df676
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Oct 9 17:45:38 2014 +0300

Cleaned

commit 7dd6f38cd62b7104a521b015e0add9073846874b
Author: ismail <ismail@dev-fedora.localdomain>
Date: Thu Oct 9 17:43:57 2014 +0300

Added FileList class Dump Load and unload

commit aac24300618cfb116966cedcc56602772c207269
Author: ismail <ismail@dev-fedora.localdomain>
Date: Thu Oct 9 16:05:15 2014 +0300

Working exception handler added

commit 690e53c9f42050b3b0a44c0daf39ca75b96ac702
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Oct 9 07:01:36 2014 +0300

Initial commit

commit 02fdbfa4aa055925775d1cc21df1094886171e30
Author: ismail <ismail@dev-fedora.localdomain>
Date: Wed Oct 8 14:45:22 2014 +0300

First not working version
[ismail@dev-fedora test]$ git status
On branch master
Your branch is behind ‘origin/master’ by 1 commit, and can be fast-forwarded.
(use “git pull” to update your local branch)

LEARN MORE  How To Count Words In A Sentence In Python?

nothing to commit, working directory clean
[ismail@dev-fedora test]$ cd ..
[ismail@dev-fedora ~]$ cd file_mac/
[ismail@dev-fedora file_mac]$ cat README.md

file_hash

New functionality
[ismail@dev-fedora file_mac]$ git log
commit b12dcd29b13f292c1debdd0d638e51103952356e
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 03:25:23 2014 +0200

New func

commit fbbb8a504c286364f7963c9873393a5ef9f9e85d
Merge: 288eab5 690e53c
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Sat Oct 11 07:36:10 2014 +0300

Merge branch ‘master’ of https://github.com/ibaydan/file_hash

commit 288eab5369cbb612a168fb918ccf3d1e819df676
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Oct 9 17:45:38 2014 +0300

Cleaned

commit 7dd6f38cd62b7104a521b015e0add9073846874b
Author: ismail <ismail@dev-fedora.localdomain>
Date: Thu Oct 9 17:43:57 2014 +0300

Added FileList class Dump Load and unload

commit aac24300618cfb116966cedcc56602772c207269
Author: ismail <ismail@dev-fedora.localdomain>
Date: Thu Oct 9 16:05:15 2014 +0300

Working exception handler added

commit 690e53c9f42050b3b0a44c0daf39ca75b96ac702
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Oct 9 07:01:36 2014 +0300

Initial commit

commit 02fdbfa4aa055925775d1cc21df1094886171e30
Author: ismail <ismail@dev-fedora.localdomain>
Date: Wed Oct 8 14:45:22 2014 +0300

First not working version
[ismail@dev-fedora file_mac]$ cd ..
[ismail@dev-fedora ~]$ cd test/
[ismail@dev-fedora test]$ ls
lib.py main.py README.md
[ismail@dev-fedora test]$ git log
commit fbbb8a504c286364f7963c9873393a5ef9f9e85d
Merge: 288eab5 690e53c
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Sat Oct 11 07:36:10 2014 +0300

Merge branch ‘master’ of https://github.com/ibaydan/file_hash

commit 288eab5369cbb612a168fb918ccf3d1e819df676
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Oct 9 17:45:38 2014 +0300

Cleaned

commit 7dd6f38cd62b7104a521b015e0add9073846874b
Author: ismail <ismail@dev-fedora.localdomain>
Date: Thu Oct 9 17:43:57 2014 +0300

Added FileList class Dump Load and unload

commit aac24300618cfb116966cedcc56602772c207269
Author: ismail <ismail@dev-fedora.localdomain>
Date: Thu Oct 9 16:05:15 2014 +0300

Working exception handler added

commit 690e53c9f42050b3b0a44c0daf39ca75b96ac702
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Oct 9 07:01:36 2014 +0300

Initial commit

commit 02fdbfa4aa055925775d1cc21df1094886171e30
Author: ismail <ismail@dev-fedora.localdomain>
Date: Wed Oct 8 14:45:22 2014 +0300

First not working version
[ismail@dev-fedora test]$ git fetch
[ismail@dev-fedora test]$ git fetch origin master
From /home/ismail/file_mac
* branch master -> FETCH_HEAD
[ismail@dev-fedora test]$ git log
commit fbbb8a504c286364f7963c9873393a5ef9f9e85d
Merge: 288eab5 690e53c
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Sat Oct 11 07:36:10 2014 +0300

Merge branch ‘master’ of https://github.com/ibaydan/file_hash

commit 288eab5369cbb612a168fb918ccf3d1e819df676
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Oct 9 17:45:38 2014 +0300

Cleaned

commit 7dd6f38cd62b7104a521b015e0add9073846874b
Author: ismail <ismail@dev-fedora.localdomain>
Date: Thu Oct 9 17:43:57 2014 +0300

Added FileList class Dump Load and unload

commit aac24300618cfb116966cedcc56602772c207269
Author: ismail <ismail@dev-fedora.localdomain>
Date: Thu Oct 9 16:05:15 2014 +0300

Working exception handler added

commit 690e53c9f42050b3b0a44c0daf39ca75b96ac702
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Oct 9 07:01:36 2014 +0300

Initial commit

commit 02fdbfa4aa055925775d1cc21df1094886171e30
Author: ismail <ismail@dev-fedora.localdomain>
Date: Wed Oct 8 14:45:22 2014 +0300

First not working version
[ismail@dev-fedora test]$ cat README.md

file_hash

[ismail@dev-fedora test]$ git remote show origin
* remote origin
Fetch URL: /home/ismail/file_mac
Push URL: /home/ismail/file_mac
HEAD branch: master
Remote branch:
master tracked
Local branch configured for ‘git pull’:
master merges with remote master
Local ref configured for ‘git push’:
master pushes to master (local out of date)
[ismail@dev-fedora test]$ git tag
[ismail@dev-fedora test]$ git tag -a v1
[ismail@dev-fedora test]$ git tag
v1
[ismail@dev-fedora test]$ git show v1
tag v1
Tagger: İsmail Baydan <ibaydan@gmail.com>
Date: Thu Nov 13 03:34:09 2014 +0200

version 1

commit fbbb8a504c286364f7963c9873393a5ef9f9e85d
Merge: 288eab5 690e53c
Author: İsmail Baydan <ibaydan@gmail.com>
Date: Sat Oct 11 07:36:10 2014 +0300

Merge branch ‘master’ of https://github.com/ibaydan/file_hash

[ismail@dev-fedora test]$ git tag -a v0.5 7dd6f38cd62b7104a521b015e0add9073846874b
[ismail@dev-fedora test]$ git config –global alias.ci commit
[ismail@dev-fedora test]$ git config –gloabl
error: unknown option gloabl'
usage: git config [options]

Config file location
--global use global config file
--system use system config file
--local use repository config file
-f, --file <file> use given config file
--blob <blob-id> read config from given blob object

Action
--get get value: name [value-regex]
--get-all get all values: key [value-regex]
--get-regexp get values for regexp: name-regex [value-regex]
--get-urlmatch get value specific for the URL: section[.var] URL
--replace-all replace all matching variables: name value [value_regex]
--add add a new variable: name value
--unset remove a variable: name [value-regex]
--unset-all remove all matches: name [value-regex]
--rename-section rename section: old-name new-name
--remove-section remove a section: name
-l, --list list all
-e, --edit open an editor
--get-color <slot> find the color configured: [default]
--get-colorbool <slot>
find the color setting: [stdout-is-tty]

Type
--bool value is "true" or "false"
--int value is decimal number
--bool-or-int value is --bool or --int
--path value is a path (file or directory name)

Other
-z, --null terminate values with NUL byte
--includes respect include directives on lookup

[ismail@dev-fedora test]$ git config --gloabl -l
error: unknown option
gloabl’
usage: git config [options]

Config file location
–global use global config file
–system use system config file
–local use repository config file
-f, –file <file> use given config file
–blob <blob-id> read config from given blob object

Action
–get get value: name [value-regex]
–get-all get all values: key [value-regex]
–get-regexp get values for regexp: name-regex [value-regex]
–get-urlmatch get value specific for the URL: section[.var] URL
–replace-all replace all matching variables: name value [value_regex]
–add add a new variable: name value
–unset remove a variable: name [value-regex]
–unset-all remove all matches: name [value-regex]
–rename-section rename section: old-name new-name
–remove-section remove a section: name
-l, –list list all
-e, –edit open an editor
–get-color <slot> find the color configured: [default]
–get-colorbool <slot>
find the color setting: [stdout-is-tty]

Type
–bool value is “true” or “false”
–int value is decimal number
–bool-or-int value is –bool or –int
–path value is a path (file or directory name)

Other
-z, –null terminate values with NUL byte
–includes respect include directives on lookup

[ismail@dev-fedora test]$ git config –global -l
user.name=İsmail Baydan
user.email=ibaydan@gmail.com
alias.ci=commit
[ismail@dev-fedora test]$

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/git-tutorial/
PINTEREST
PINTEREST
INSTAGRAM

Leave a Reply

Your email address will not be published.