Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Sharing of git file management experience

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Untraked file untracked files, usually newly created files

Traked file is usually the file after indexing

Ignored ignored files, this type of file is usually in a file list. The file that maintains this list is named .gitignore in the root directory of the version library.

Initialize the version library to ensure the newly created state

Huawei@DESKTOP-JTC012C MINGW64 ~ / Desktop/git-repo (master) $ls hello huawei@DESKTOP-JTC012C MINGW64 ~ / Desktop/git-repo (master) $ls-a. /.. / .git / hello huawei@DESKTOP-JTC012C MINGW64 ~ / Desktop/git-repo (master) $rm-rf. Git / hello huawei@DESKTOP-JTC012C MINGW64 ~ / Desktop/git-repo $git init Initialized empty Git repository in C:/Users/huawei/Desktop/git-repo/.git/

Create files to view file types and find files that are not tracked by untraked file

Huawei@DESKTOP-JTC012C MINGW64 ~ / Desktop/git-repo (master) $echo "hello world" > hello huawei@DESKTOP-JTC012C MINGW64 ~ / Desktop/git-repo (master) $git status On branch master No commits yet Untracked files: (use "git add..." To include in what will be committed) hello nothing added to commit but untracked files present (use "git add" to track)

The files being tracked are usually indexed and can be viewed through git ls-files-s. For ignored files, please see the following demo and write the file name to the .gitignore file.

Huawei@DESKTOP-JTC012C MINGW64 ~ / Desktop/git-repo (master) $git status On branch master nothing to commit, working tree clean huawei@DESKTOP-JTC012C MINGW64 ~ / Desktop/git-repo (master) $echo "a" > a huawei@DESKTOP-JTC012C MINGW64 ~ / Desktop/git-repo (master) $git status On branch master Untracked files: (use "git add..." To include in what will be committed) a nothing added to commit but untracked files present (use "git add" to track) huawei@DESKTOP-JTC012C MINGW64 ~ / Desktop/git-repo (master) $echo a > > .gitignore huawei@DESKTOP-JTC012C MINGW64 ~ / Desktop/git-repo (master) $git status On branch master Untracked files: (use "git add..." To include in what will be committed) .gitignore nothing added to commit but untracked files present (use "git add" to track)

.gitignore file syntax

The lines at the beginning of # are used for comments

Blank lines will be commented

The end of the directory name is marked with a backslash (/)

Contains shell wildcards, such as *. Example debug/32bit/*.o

The starting exclamation point is used to take the anti-pattern.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report