git工具

时间:2023-03-09 18:18:12
git工具

1.Git Bash常用命令:

pwd    当前工作目录

clear   清屏

ls   列举当前目录下的文件及文件夹

cd 更改目录

mkdir   创建目录

touch   创建空文件

cp 拷贝

rm 移除

mv   移动文件,可用来对文件重命名

date   当前日期

echo 回显

​2.基本Git命令-1:

​git add

git commit

git push

git add . add all new files

git add -u updates tracking forfiles that changed names or were deleted

git add A does both

git commit -m "message"

git push

branches

git checkout -b branchname-->create a branch

git branch    see what branch you are on

git checkout master   switch back to the master type

3.常用文件操作命令:

git status 查看文件状态

git add  跟踪新文件或暂存已修改文件

git diff  查看文件变化

git  commit –m <</span>msg> 提交更新

git rm file  移除文件

git  log 查看提交日志

git commit –ammend    修改最后一次提交

git reset HEAD  取消已暂存文件