In both cases, you will need to use the same Git command : GitAdd. In this tutorial, you will learn how you can easily add all your files to your Git repository.
Yes, you can use a .gitignore file to specify patterns of files that Git should ignore. Files matching these patterns will not be staged when using gitadd ..
adds / stages all of the files in the current directory. This is for convenience, and can still be used if you have certain files you don't want to add by using a
.gitignore
A tutorial for
.gitignore
is located here.A deeper look into
git add .
vs
git add -A
vs.
git add -u
is located here and it might answer your question if you wanted more control of how you add all of the files / wanted to know how
git add .
works.
23 Mayıs 2017
101 kişi değerlendirdi
2 yorum
{"2_2snq":{"state":{"logo":{"href":"//yandex.com.tr","isForeign":true},"form":{"action":"/search","searchLabel":"Bul","hiddenInputs":[{"name":"lr","value":20815}]},"actions":{"advancedSearch":{"checked":false,"ariaLabel":"Gelişmiş arama"},"moreButtonProps":{"ariaLabel":"Daha fazla"},"cbir":{"name":"cbir","label":"Поиск по картинке","infoUrl":"//yandex.ru/promo/photosearch/index?source=landingdesk","isMacOS":false}},"userSection":{"loggedIn":false,"loginProps":{"loginUrl":"https://passport.yandex.com.tr/auth?retpath=%2F&origin=serp_desktop_auth_new","loginText":"Giriş yap","burgerAriaLabel":"Menü"}},"navigation":{"tabs":[{"id":"www","label":"Arama","url":"//yandex.com.tr","params":{"source":"tabbar"},"target":""},{"id":"images","label":"Görsel","url":"//yandex.com.tr/gorsel/search","params":{"text":"[$query]","noreask":"[$noreask]","nomisspell":"[$nomisspell]","parent-reqid":"[$reqid]","from":"tabbar"}},{"id":"video","label":"Video","url":"//yandex.com.tr/video/search","params":{"text":"[$query]","parent-reqid":"[$reqid]","from":"tabbar"}},{"id":"maps","label":"Haritalar","url":"//yandex.com.tr/harita","params":{"text":"[$query]","source":"serp_navig"}},{"id":"translate","label":"Çeviri","url":"//ceviri.yandex.com.tr","params":{"text":"[$query]","from":"tabbar"}}],"selectedTabId":"www","fixedTabsCount":1},"context":{"query":"git add","reqid":"1720170025038063-391301025243321421-balancer-l7leveler-kubr-yp-sas-159-BAL","noreask":"1","lr":"20815","counters":{"type":"b","data":{"$header":"0_byswz000","logo":"0_byswz001","login":"0_byswz003","usermenu":"0_byswz004","market-cart":"0_byswz006","more-button":"0_byswz007","cbir":"0_byswz008","$navigation":"0_byswz009","item":"0_byswz00i","tab-www":"0_byswz00b","tab-images":"0_byswz00d","tab-video":"0_byswz00f","tab-maps":"0_byswz00h","tab-translate":"0_byswz00j"}}},"loggedIn":false,"baobab":{"parentNode":{"context":{"genInfo":{"prefix":"0_bysww01-0-1"},"ui":"desktop","service":"web","reqid":"1720170025038063-391301025243321421-balancer-l7leveler-kubr-yp-sas-159-BAL","fast":{"name":"header-desktop"}}}}},"type":"header-desktop"},"2_bysw0":{"state":{"answersUrl":"https://stackoverflow.com/questions/16969768/what-does-the-git-add-git-add-single-dot-command-do#answers","type":"fact","tabsOptions":[{"id":"question","text":"Soru"},{"id":"bestAnswer","text":"En iyi yanıt"},{"id":"moreAnswers","text":"3 yanıt daha","shortText":"Daha fazla"}],"tabContents":{"question":{"construct":[{"type":"paragraph","content":[{"type":"text","content":"I don't get what the Git command means, when adding files to the stage with the use of a period (or full stop, single dot):"}]},{"type":"code","content":[{"type":"text","content":"git add ."}]},{"type":"paragraph","content":[{"type":"text","content":"What does this do?"}]}],"footerProps":{"date":1701615570,"numLiked":85,"numCommented":1}},"bestAnswer":{"construct":[{"type":"paragraph","content":[{"type":"code","content":[{"type":"text","content":"git add ."}],"isInline":true},{"type":"text","content":" adds / stages all of the files in the current directory. This is for convenience, and can still be used if you have certain files you don't want to add by using a "},{"type":"code","content":[{"type":"text","content":".gitignore"}],"isInline":true}]},{"type":"paragraph","content":[{"type":"text","content":"A tutorial for "},{"type":"code","content":[{"type":"text","content":".gitignore"}],"isInline":true},{"type":"text","content":" is located "},{"type":"text","content":"here"},{"type":"text","content":"."}]},{"type":"paragraph","content":[{"type":"text","content":"A deeper look into "},{"type":"code","content":[{"type":"text","content":"git add ."}],"isInline":true},{"type":"text","content":" vs "},{"type":"code","content":[{"type":"text","content":"git add -A"}],"isInline":true},{"type":"text","content":" vs. "},{"type":"code","content":[{"type":"text","content":"git add -u"}],"isInline":true},{"type":"text","content":" is located "},{"type":"text","content":"here"},{"type":"text","content":" and it might answer your question if you wanted more control of how you add all of the files / wanted to know how "},{"type":"code","content":[{"type":"text","content":"git add ."}],"isInline":true},{"type":"text","content":" works."}]}],"footerProps":{"date":1495529212,"numLiked":101,"numCommented":2}},"moreAnswers":[{"construct":[{"type":"paragraph","content":[{"type":"code","content":[{"type":"text","content":"git add ."}],"isInline":true},{"type":"text","content":" adds all modified and new (untracked) files in the current directory and all subdirectories to the staging area (a.k.a. the index), thus preparing them to be included in the next "},{"type":"code","content":[{"type":"text","content":"git commit"}],"isInline":true},{"type":"text","content":"."}]},{"type":"paragraph","content":[{"type":"text","content":"Any files matching the patterns in the "},{"type":"code","content":[{"type":"text","content":".gitignore"}],"isInline":true},{"type":"text","content":" file will be ignored by "},{"type":"code","content":[{"type":"text","content":"git add"}],"isInline":true},{"type":"text","content":"."}]},{"type":"paragraph","content":[{"type":"text","content":"If you want to skip the "},{"type":"code","content":[{"type":"text","content":"git add ."}],"isInline":true},{"type":"text","content":" step you can just add the "},{"type":"code","content":[{"type":"text","content":"-a"}],"isInline":true},{"type":"text","content":" flag to "},{"type":"code","content":[{"type":"text","content":"git commit"}],"isInline":true},{"type":"text","content":" (though that will include "},{"type":"text","content":"all"},{"type":"text","content":" modified files, not just in the current and subdirectories)."}]},{"type":"paragraph","content":[{"type":"text","content":"Note that "},{"type":"code","content":[{"type":"text","content":"git add ."}],"isInline":true},{"type":"text","content":" will not do anything about deleted files. To include deletions in the index (and the comming commit) you need to do "},{"type":"code","content":[{"type":"text","content":"git add -A"}],"isInline":true}]}],"footerProps":{"date":1370530646,"numLiked":37,"numCommented":0}},{"construct":[{"type":"paragraph","content":[{"type":"text","content":"It adds all subsequent resources (on which you have made changes) under that folder to Git's version control for commit."}]},{"type":"paragraph","content":[{"type":"text","content":"You should learn Git from this excellent walkthrough: "},{"type":"text","content":"Resources to learn Git"}]}],"footerProps":{"date":1570282992,"numLiked":4,"numCommented":0}}]},"organic":{"faviconProps":{"src":"https://favicon.yandex.net/favicon/v2/https://stackoverflow.com","size":"m","pageNumber":0,"index":0},"title":"What does the '\u0007[git\u0007] \u0007[add\u0007] .' ('\u0007[git\u0007] \u0007[add\u0007]' single dot) command do?","pathProps":{"items":[{"url":"https://stackoverflow.com/questions/16969768/what-does-the-git-add-git-add-single-dot-command-do","text":"stackoverflow.com"},{"url":"https://stackoverflow.com/questions/16969768/what-does-the-git-add-git-add-single-dot-command-do","text":"what-does-the-git-add-git-add-single-dot-command-do"}]},"faviconPosition":0,"subtitlePosition":1,"linkProps":{"url":"https://stackoverflow.com/questions/16969768/what-does-the-git-add-git-add-single-dot-command-do"},"hostTitle":"stackoverflow.com","description":""},"extralinksProps":{"hidden":true,"directions":["bottom-end"],"items":[{"variant":"reportFeedback","reportFeedback":{"feature":"Блок ответов для разработчиков","title":"Bu yanıtta yanlış olan nedir?","checkBoxLabels":[{"value":"Yanıt sorguya uygun değil"},{"value":"Yanıt hatalı"},{"value":"Yanıttaki bilgiler eksik"},{"value":"Diğer"}]}}]},"baobab":{"parentNode":{"context":{"genInfo":{"prefix":"2_bysww0c-0-1"},"ui":"desktop","service":"web","reqid":"1720170025038063-391301025243321421-balancer-l7leveler-kubr-yp-sas-159-BAL","fast":{"name":"article"}}}}},"type":"article"},"2_bysw1":{"state":{"linksGroups":[{"type":"geo","links":[{"label":"Columbus","title":"Columbus","url":"//yandex.com.tr/tune/geo","logNode":{"name":"region"},"target":"_self","a11yLabel":"Bölgeniz Columbus","needRetpath":true}]},{"type":"feedback","links":[{"label":"Hata bildir","logNode":{"name":"feedback","attrs":{"behaviour":{"type":"dynamic"}}}}]},{"type":"settings","links":[{"label":"Ayarlar","url":"//yandex.com.tr/tune/search","logNode":{"name":"settings"},"target":"_self","needRetpath":true}]},{"type":"company","links":[{"label":"Hakkımızda","url":"https://company.yandex.com.tr","logNode":{"name":"about"},"target":"_blank"},{"label":"Ticari teklifler","url":"/search/direct?text=git%20add&filters_docs=direct_cm","logNode":{"name":"commercial"},"target":"_blank"},{"label":"Kariyer","url":"//yandex.com.tr/jobs/?utm_source=serp_turkie&utm_medium=footerlink&utm_content=career","logNode":{"name":"vacancy"},"target":"_blank"},{"label":"Kullanım lisansı","url":"//yandex.com.tr/legal/termsofuse/","logNode":{"name":"license"},"target":"_blank"},{"label":"Gizlilik Politikası","url":"//yandex.com.tr/legal/confidential/","logNode":{"name":"confidential"},"target":"_blank"}],"a11yHidden":true}],"reportFeedbackProps":{"feature":"Подвал","title":"Hata bildir","checkBoxLabels":[]},"isSearchApp":false,"hasExtralinks":true,"limitingSelector":".AliceFabButton","baobab":{"parentNode":{"context":{"genInfo":{"prefix":"2_bysww0d-0-1"},"ui":"desktop","service":"web","reqid":"1720170025038063-391301025243321421-balancer-l7leveler-kubr-yp-sas-159-BAL"}}}},"type":"serp-footer"},"2_bysw2":{"state":{"conditionLoadList":{"marketCart":false,"highchartsHighstock":false,"advProductGallery":false,"musicPlayer":false,"ecomRates":false,"photoViewer":false,"darkmodeChangeDrawer":true},"reportFeedbackBaseProps":{"initEmail":"","metaFields":{"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","userTestids":"186144,1010398,1020665,1054384,1052824,1050491,1051377,1055712,1038759,1045865,1048634,1054624,1043103,1052660,1050637,1045180,1052306,1056975,936724,1056567,1046931,1045124,1036352,1049027,1051714,1047787,1050775,1054081,1056358,260561,90495,89013,1048609,1058161,1053973,1045506,1056482,1054781,1037487,1048183,1056096,663893,728509,259953,1045239,151171,128378,126312,126339,1040469,1056962,1058166,13963,287509,338390,785124,1055733,1036086,1043953,1054351,1058297,1053481,912285","yandexuid":"2757752151720170008","uid":"0","queryText":"git add","reqid":"1720170025038063-391301025243321421-balancer-l7leveler-kubr-yp-sas-159-BAL","searchSlices":["drawer_search_slice_english","drawer_search_slice_cs"],"userRegionName":"Columbus","userRegionId":"20815"}},"extralinksPopupProps":{"abuseLink":"https://twitter.yandex.com.tr/search/abuse?sign=3247285f73b7573ba9e2bfaa75b054fe&keyno=0"},"isLoggedIn":false,"userMenuDialogProps":{"flag":"skin,feedback","host":"yandex.com.tr","lang":"tr","project":"serp","queryParams":{"utm_source":"search"},"retpath":"https%3A%2F%2Ftwitter.yandex.com.tr%2Fsearch%3Flr%3D20815%26noreask%3D1%26rq%3D1%26serp-reload-from%3Drec_bottom%26source%3Dtabbar%26text%3Dgit%2Badd%26ncrnd%3D29074","tld":"com.tr"},"baobab":{"parentNode":{"context":{"genInfo":{"prefix":"2_bysww0e-0-1"},"ui":"desktop","service":"web","reqid":"1720170025038063-391301025243321421-balancer-l7leveler-kubr-yp-sas-159-BAL","fast":{"name":"lazy-load"}}}}},"type":"lazy-load"}}