어떤 폴더의 일부는 git에 포함되어야하고, 일부는 포함되지 말아야할 때!
(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django(master⚡) » mkdir ignore_test
(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django(master⚡) » cd ignore_test
(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django/ignore_test(master⚡) » ls -al > should_include.txt
(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django/ignore_test(master⚡) » ls -al > should_NOT_include.txt
(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django/ignore_test(master⚡) » ls -al
total 16
drwxr-xr-x 4 marie staff 128 Jul 12 10:53 .
drwxr-xr-x 11 marie staff 352 Jul 12 10:53 ..
-rw-r--r-- 1 marie staff 239 Jul 12 10:53 should_NOT_include.txt
-rw-r--r-- 1 marie staff 170 Jul 12 10:53 should_include.txt
(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django/ignore_test(master⚡) » cd ..
(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django(master⚡) »
(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django(master⚡) » git status
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
.gitignore
.idea/
django_player/
ignore_test/
manage.py
nothing added to commit but untracked files present (use "git add" to track)
(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django(master⚡) »
(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django(master⚡) » cat .gitignore|grep should
*/should_NOT_include.txt
# When using Gradle or Maven with auto-import, you should exclude module files,
(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django(master⚡) »
(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django(master⚡) » git status
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
.gitignore
.idea/
django_player/
ignore_test/
manage.py
nothing added to commit but untracked files present (use "git add" to track)
(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django(master⚡) » git add ignore_test/
(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django(master⚡) » git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: ignore_test/should_include.txt
Untracked files:
(use "git add <file>..." to include in what will be committed)
.gitignore
.idea/
django_player/
manage.py
(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django(master⚡) »
(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django(master⚡) » git commit -m "gitignore test" 129 ↵
[master c1d5920] gitignore test
1 file changed, 4 insertions(+)
create mode 100644 ignore_test/should_include.txt
(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django(master⚡) » git push origin master
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 12 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 424 bytes | 424.00 KiB/s, done.
Total 4 (delta 0), reused 0 (delta 0)
To https://github.com/EunkyoungJung/play-django.git
4b2a07b..c1d5920 master -> master
(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django(master⚡) »
(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django(master⚡) »
(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django(master⚡) »
(venv) (base) marie@MarieJucBookPro:~/PycharmProjects/play-with-django(master⚡) »