2024年3月22日发(作者:)
GIT ANG REPO USAGE
1 git command
1.1 git add
•
git add . #将文件先暂存到staging area, stages new and modified, without
deleted
•
git add -A #states all
•
git add -u #states modified and deleted, without new
•
git add -i #进入互动模式
•
git add filename #新增一个文件
•
git add modify-file #修改过得文档也要加add,不然在commit时要加-a
1.2 git rm #删除文件
•
git rm filename
1.3 git mv #修改文件名,或搬移目录
•
git mv filename newfilename
1.4 git status #查看状态
1.5 git commit
•
git commit
•
git commit -m 'commit message'
•
git commit -a -m "message"
•
git commit -a -v #-v查看修改的内容
1.6 git branch
•
git branch #列出所有的分支
•
git branch new-branch #产生新的分支
•
git branch new-branch master #由master产生新的分支
•
git branch -d branch #删除分支
•
git branch -D branch #强制删除分支
•
git checkout -b new-branch #产生新分支并切换过去
发布评论