some notes about git
3512 단어 Note
git config --global user.name "John Doe"
git config --global user.email [email protected]
to add user name & email
then git config --list to check.
git help config to seek help.
You can get a Git project using two main approaches. The first takes an existing project or directory and imports it into Git. The second clones an existing Git repository from another server.
git init
git add *.html
git commit -m "first one"
now we build the repository here.
You clone a repository with
git clone [url]
. For example, if you want to clone the Ruby Git library called Grit, you can do so like this: $ git clone git://github.com/schacon/grit.git
The main tool you use to determine which files are in which state is the git status
command. To stage it, you run the git add
command (it’s a multipurpose command — you use it to begin tracking new files, to stage files, and to do other things like marking merge-conflicted files as resolved).
If you want to see what you’ve staged that will go into your next commit, you can use
git diff --cached
. (In Git versions 1.6.1 and later, you can also use git diff --staged
, which may be easier to remember.) This command compares your staged changes to your last commit: Although it can be amazingly useful for crafting commits exactly how you want them, the staging area is sometimes a bit more complex than you need in your workflow. If you want to skip the staging area, Git provides a simple shortcut. Providing the
-a
option to the git commit
command makes Git automatically stage every file that is already tracked before doing the commit, letting you skip the git
git commit -a -m "commit without staged"
To remove a file from Git, you have to remove it from your tracked files (more accurately, remove it from your staging area) and then commit. The
git rm
command does that and also removes the file from your working directory so you don’t see it as an untracked file next time around. If you simply remove the file from your working directory, it shows up under the “Changes not staged for commit” (that is, unstaged) area of your
git status
output: use git rm --cached to keep the file in your working tree but remove it from your staging area.
git mv can rename files
git log to check historial records. One of the more helpful options is
-p
, which shows the diff introduced in each commit. You can also use -2
, which limits the output to only the last two entries:
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Zabbix의Graphid를 통해 이미지 다운로드--제2판api의 검색 방법은 ql와 같습니다.zabbix를 통해agent_host는 hostid를 찾았고 hostid와 itemkey에 따라itemid를 찾았으며 Itemid를 통해graphid를 찾았습니다.그리고 사진을 ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.