GIT CMD käsurida

Git CMD Konfigureerimine:

git config –global user.name “IrinaMerkulova”
git config –global user.email “imerkulova
@..”

Konfigureerimise kontroll:

git config user.name
git config user.email
git config –global –list

Git repositooriumi kloonime

git clone O:\TARGV21\tund1Git

git status – Kasutaja staatuse kontroll

Branch – Haru loomine / Oksa loomine / создание ветки

git branch IrinaM

Haru vahetamine/ переключение ветки

git checkout IrinaM

Haru kustutamine / удаление ветки git branch -d IrinaM

Failide lisamine / добавление файла git add .

Muudatuste registreerimine ja kommenteerimine

git commit -a -m “nimi on lisatud”

Muudatuste üles laadimine serverisse

git push
git push –set-upstream origin IrinaM

притянуть позже добавленный файл с сервера git pull origin main

git init “repoNimi” – uue repo loomine

C:\Users\opilane>cd desktop

C:\Users\opilane\Desktop>cd ..

C:\Users\opilane>cd desktop

C:\Users\opilane\Desktop>git config –global user.name “Vitalii Sokhan”

C:\Users\opilane\Desktop>git config –global user.email “svjfox@gmail.com”

C:\Users\opilane\Desktop>git config user.name
Vitalii Sokhan

C:\Users\opilane\Desktop>git config user.email
svjfox@gmail.com

C:\Users\opilane\Desktop>git config –global –list
eser.name=Vitalii sokhan
user.emeil=svjfox@gmail.com
user.name=Vitalii Sokhan
user.email=svjfox@gmail.com

C:\Users\opilane\Desktop>

C:\Users\opilane\Desktop>git clone S:\TARgv23git\welcome
Cloning into ‘welcome’…
done.

C:\Users\opilane\Desktop\welcome>git branch Vitalii
fatal: a branch named ‘Vitalii’ already exists

C:\Users\opilane\Desktop\welcome>git checkout Vitalii
Already on ‘Vitalii’
M Nimi.txt
Your branch is up to date with ‘origin/Vitalii’.

C:\Users\opilane\Desktop\welcome>git push –set-upstream origin Vitalii
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
To S:\TARgv23git\welcome

  • [new branch] Vitalii -> Vitalii
    branch ‘Vitalii’ set up to track ‘origin/Vitalii’.

C:\Users\opilane\Desktop\welcome>cd welcome
The system cannot find the path specified.

C:\Users\opilane\Desktop\welcome>git status
On branch Vitalii
Your branch is up to date with ‘origin/Vitalii’.

Changes not staged for commit:
(use “git add …” to update what will be committed)
(use “git restore …” to discard changes in working directory)
modified: Nimi.txt

no changes added to commit (use “git add” and/or “git commit -a”)

C:\Users\opilane\Desktop\welcome>gid add .
‘gid’ is not recognized as an internal or external command,
operable program or batch file.

C:\Users\opilane\Desktop\welcome>git push
Everything up-to-date

C:\Users\opilane\Desktop\welcome>git status
On branch Vitalii
Your branch is up to date with ‘origin/Vitalii’.

Changes to be committed:
(use “git restore –staged …” to unstage)
modified: Nimi.txt

C:\Users\opilane\Desktop\welcome>git add .

C:\Users\opilane\Desktop\welcome>git commit -a -m “nimi Vitalii Lisetud”
[Vitalii f616c76] nimi Vitalii Lisetud
1 file changed, 1 insertion(+), 1 deletion(-)

C:\Users\opilane\Desktop\welcome>git push
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Writing objects: 100% (3/3), 281 bytes | 281.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
To S:\TARgv23git\welcome
9c5754a..f616c76 Vitalii -> Vitalii

C:\Users\opilane\Desktop\welcome>

C:\Users\opilane\Desktop\welcome>git commit -a -m “Otvet 1”
[Vitalii 1089ef7] Otvet 1

C:\Users\opilane\Desktop\welcome>git push
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 8 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 1001 bytes | 1001.00 KiB/s, done.
Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
To S:\TARgv23git\welcome
f616c76..1089ef7 Vitalii -> Vitalii

C:\Users\opilane\Desktop\welcome>git commit -a -m “Otvet 2”
On branch Vitalii
Your branch is up to date with ‘origin/Vitalii’.

nothing to commit, working tree clean

C:\Users\opilane\Desktop\welcome>git push
Everything up-to-date

C:\Users\opilane\Desktop\welcome>git commit -a -m “Otvet 2”
[Vitalii d68645a] Otvet 2
1 file changed, 1 insertion(+)

C:\Users\opilane\Desktop\welcome>git push
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 8 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 316 bytes | 316.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
To S:\TARgv23git\welcome
1089ef7..d68645a Vitalii -> Vitalii

C:\Users\opilane\Desktop\welcome>

C:\Users\opilane>S:

S:>cd TARgv23git

S:\TARgv23git>git init Sokhangit
Initialized empty Git repository in //tthk.ee/home/Opilastetood/TARgv23git/Sokhangit/.git/

S:\TARgv23git>cdd Merkulovagit
‘cdd’ is not recognized as an internal or external command,
operable program or batch file.

S:\TARgv23git>cdd Sokhangit
‘cdd’ is not recognized as an internal or external command,
operable program or batch file.

S:\TARgv23git>cd Sokhangit

S:\TARgv23git\Sokhangit>git status
On branch master

No commits yet

Untracked files:
(use “git add …” to include in what will be committed)
Uus tekstidokument.txt

nothing added to commit but untracked files present (use “git add” to track)

S:\TARgv23git\Sokhangit>git add .

S:\TARgv23git\Sokhangit>git commit -a -m “ylesane on lisatud”
[master (root-commit) 56db072] ylesane on lisatud
1 file changed, 2 insertions(+)
create mode 100644 Uus tekstidokument.txt

S:\TARgv23git\Sokhangit>
S:\TARgv23git\Sokhangit>git clone S:\TARgv23git\Rudenkogit
Cloning into ‘Rudenkogit’…
done.

S:\TARgv23git\Sokhangit>cd desktop
The system cannot find the path specified.

S:\TARgv23git\Sokhangit>cd ..

S:\TARgv23git>C:

C:\Users\opilane>cd desktop

C:\Users\opilane\Desktop>git clone S:\TARgv23git\Rudenkogit
Cloning into ‘Rudenkogit’…
done.

C:\Users\opilane\Desktop>git clone S:\TARgv23git\Pahhomovgit
Cloning into ‘Pahhomovgit’…
done.

C:\Users\opilane\Desktop>git add.
git: ‘add.’ is not a git command. See ‘git –help’.

The most similar command is
add

C:\Users\opilane\Desktop>git add .
fatal: not a git repository (or any of the parent directories): .git

C:\Users\opilane\Desktop>C:Rudenkogit
‘C:Rudenkogit’ is not recognized as an internal or external command,
operable program or batch file.

C:\Users\opilane\Desktop>cd Rudenkogit

C:\Users\opilane\Desktop\Rudenkogit>git status
On branch master
Your branch is up to date with ‘origin/master’.

Changes not staged for commit:
(use “git add …” to update what will be committed)
(use “git restore …” to discard changes in working directory)
modified: “K\303\274simused.txt”

no changes added to commit (use “git add” and/or “git commit -a”)

C:\Users\opilane\Desktop\Rudenkogit>git branch Vitalii

C:\Users\opilane\Desktop\Rudenkogit>git checkout Vitalii
Switched to branch ‘Vitalii’
M “K\303\274simused.txt”

C:\Users\opilane\Desktop\Rudenkogit>git status
On branch Vitalii
Changes not staged for commit:
(use “git add …” to update what will be committed)
(use “git restore …” to discard changes in working directory)
modified: “K\303\274simused.txt”

no changes added to commit (use “git add” and/or “git commit -a”)

C:\Users\opilane\Desktop\Rudenkogit>git add .

C:\Users\opilane\Desktop\Rudenkogit>git status
On branch Vitalii
Changes to be committed:
(use “git restore –staged …” to unstage)
modified: “K\303\274simused.txt”

C:\Users\opilane\Desktop\Rudenkogit>git push
fatal: The current branch Vitalii has no upstream branch.
To push the current branch and set the remote as upstream, use

git push --set-upstream origin Vitalii

To have this happen automatically for branches without a tracking
upstream, see ‘push.autoSetupRemote’ in ‘git help config’.

C:\Users\opilane\Desktop\Rudenkogit>git push –set-upstream origin Vitalii
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
To S:\TARgv23git\Rudenkogit

  • [new branch] Vitalii -> Vitalii
    branch ‘Vitalii’ set up to track ‘origin/Vitalii’.

C:\Users\opilane\Desktop\Rudenkogit>cd Rudenkogit
The system cannot find the path specified.

C:\Users\opilane\Desktop\Rudenkogit>git status
On branch Vitalii
Your branch is up to date with ‘origin/Vitalii’.

Changes to be committed:
(use “git restore –staged …” to unstage)
modified: “K\303\274simused.txt”

C:\Users\opilane\Desktop\Rudenkogit>git push
Everything up-to-date

C:\Users\opilane\Desktop\Rudenkogit>git checkout Vitalii
Already on ‘Vitalii’
M “K\303\274simused.txt”
Your branch is up to date with ‘origin/Vitalii’.

C:\Users\opilane\Desktop\Rudenkogit>git commit -a -m “nimi Vitalii Lisetud”
[Vitalii d091920] nimi Vitalii Lisetud
1 file changed, 7 insertions(+)

C:\Users\opilane\Desktop\Rudenkogit>git push
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 8 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 495 bytes | 495.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
To S:\TARgv23git\Rudenkogit
0270926..d091920 Vitalii -> Vitalii

C:\Users\opilane\Desktop\Rudenkogit>git pull origin master
From S:\TARgv23git\Rudenkogit

  • branch master -> FETCH_HEAD
    Already up to date.

C:\Users\opilane\Desktop\Rudenkogit>git status
On branch Vitalii
Your branch is up to date with ‘origin/Vitalii’.

nothing to commit, working tree clean

C:\Users\opilane\Desktop\Rudenkogit>git add .

C:\Users\opilane\Desktop\Rudenkogit>git commit -a -m “Otvet 1”
On branch Vitalii
Your branch is up to date with ‘origin/Vitalii’.

nothing to commit, working tree clean

C:\Users\opilane\Desktop\Rudenkogit>git add .

C:\Users\opilane\Desktop\Rudenkogit>git commit -a -m “Otvet 2”
[Vitalii a5ffef4] Otvet 2
1 file changed, 2 insertions(+), 1 deletion(-)

C:\Users\opilane\Desktop\Rudenkogit>