D:\Java\StartJava
> git init
Initialized empty Git repository in D:/Java/StartJava/.git/
// Для HTTPS
> git remote add origin https://github.com/ichimax/startjava2.git
// Для SSH
> git remote add origin git@github.com:ichimax/startjava2.git
> git remote -v
origin https://github.com/ichimax/startjava2.git (fetch)
origin https://github.com/ichimax/startjava2.git (push)
D:\Java\StartJava (master)
> git status
On branch master
No commits yet
Untracked files:
(use "git add <file>..." to include in what will be committed)
about.txt
src/
nothing added to commit but untracked files present (use "git add" to track)
D:\Java\StartJava (master)
> git add .
D:\Java\StartJava (master)
> git status
On branch master
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: about.txt
new file: src/MyFirstApp.java
D:\Java\StartJava\src (master)
> git commit
[master (root-commit) 1e36e0f] Инициализация проекта
2 files changed, 6 insertions(+)
create mode 100644 about.txt
create mode 100644 src/MyFirstApp.java
D:\Java\StartJava (master)
> git mv about.txt README.md && ls
README.md src/
# [StartJava](https://topjava.ru/startjava) — курс на Java для начинающих
## Используемые на курсе инструменты и технологии
1. Java
1. Git/GitHub
1. Командная строка
1. Sublime Text
1. Checkstyle
1. Intellij IDEA
1. SQL
1. PostgreSQL
1. psql
D:\Java\StartJava (master)
> git status
Changes to be committed:
renamed: about.txt -> README.md
Changes not staged for commit:
modified: README.md
> git status -v
Changes to be committed:
new file: README.md
deleted: about.txt
diff --git a/README.md b/README.md
+++ b/README.md
+# [StartJava](https://topjava.ru/startjava) — курс на Java для начинающих
+
+## Используемые на курсе инструменты и технологии
+
+1. Java
+1. Git/GitHub
+1. Командная строка
+1. Sublime Text
+1. Intellij IDEA
+1. SQL
+1. PostgreSQL
+1. psql
diff --git a/about.txt b/about.txt
--- a/about.txt
-Интенсив StartJava - программирование на Java для начинающих!
> git commit -m "Переименовал about.txt в README.md и внес в него описание проекта"
[master 39ba195] Переименовал about.txt в README.md и внес в него описание проекта
2 files changed, 12 insertions(+), 1 deletion(-)
create mode 100644 README.md
delete mode 100644 about.txt
> git log
commit 39ba195cf96f555aaf2d9f0a2f3ffcfb37e0c536 (HEAD -> master)
Author: ichimax <myEmail>
Date: Thu Sep 22 16:31:55 2022
Переименовал about.txt в README.md и внес в него описание проекта
commit 1e36e0f6daf70d936627c444f8cb082bfffb9b17
Author: ichimax <myEmail>
Date: Thu Sep 22 13:02:17 2022
Инициализация проекта
- добавил файл с описанием проекта
- добавил реализацию первого класса
(END)
> git log -p -1
> git log --oneline
39ba195 (HEAD -> master) Переименовал about.txt в README.md и внес в него описание проекта
1e36e0f Инициализация проекта
> git status
On branch master
nothing to commit, working tree clean
> git push -u origin master
Enumerating objects: 8, done.
Counting objects: 100% (8/8), done.
Delta compression using up to 8 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (8/8), 1.17 KiB | 238.00 KiB/s, done.
Total 8 (delta 0), reused 0 (delta 0), pack-reused 0
To https://github.com/ichimax/startjava2.git
* [new branch] master -> master
branch 'master' set up to track 'origin/master'.
public class MyFirstApp {
public static void main(String[] args) {
System.out.print("Написано однажды, ");
System.out.println("работает везде!");
}
}
> git pull
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (4/4), 942 bytes | 40.00 KiB/s, done.
From https://github.com/ichimax/startjava2
39ba195..b59d871 master -> origin/master
Updating 39ba195..b59d871
Fast-forward
src/MyFirstApp.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
D:\Java
> git clone https://github.com/ichimax/Java-Style-Guide.git
Cloning into 'Java-Style-Guide'...
remote: Enumerating objects: 69, done.
remote: Counting objects: 100% (69/69), done.
remote: Compressing objects: 100% (66/66), done.
Receiving objects: 33% (23/69)
Receiving objects: 100% (69/69), 22.24 KiB | 1.71 MiB/s, done.
Resolving deltas: 100% (19/19), done.
> cd Java-Style-Guide\ && ls -a && git status && git remote -v
./ ../ .git/ guide.md README.md
On branch main
Your branch is up to date with 'origin/main'.
nothing to commit, working tree clean
origin https://github.com/ichimax/Java-Style-Guide.git (fetch)
origin https://github.com/ichimax/Java-Style-Guide.git (push)
> javac MyFirstApp.java && ls
MyFirstApp.class MyFirstApp.java
D:\Java\StartJava (master -> origin)
> touch .gitignore
> tree /F
D:.
│ .gitignore
│ README.md
│
└───src
MyFirstApp.class
MyFirstApp.java
> git status
Untracked files:
(use "git add <file>..." to include in what will be committed)
.gitignore
src/MyFirstApp.class
.idea/
lib/
out/
*.DS_Store
*.iml
> git status
Untracked files:
(use "git add <file>..." to include in what will be committed)
.gitignore
git add .
git commit -m "Добавил .gitignore с шаблоном *.class"
git push
git log --oneline