Git 命令大全
git add . - 添加文件到暂存区。git status - 查看仓库当前的状态,显示变更的文件git commit -m 'logs' --提交到本地仓库git pull - 下载远程代码并合并git push - 上传远程代码并合并git checkout -b name - 创建新的分支git branch - 查看分支git checkout name - 切换分支git merge name - 合并分支
git init - 初始化仓库。git commit - 将暂存区内容添加到仓库中。git clone - 拷贝一个远程仓库、下载一个项目git add - 添加文件到仓库git diff - 比较文件的不同,即暂存区和工作区的差异git commit - 提交暂存区到本地仓库git reset - 回退版本git rm - 删除工作区文件git mv - 移动或重命名工作区文件git log - 查看历史提交的记录git blame <filename> - 以列表的形式查看指定文件的历史修改记录git remote - 远程仓库操作git fetch - 从远程获取代码库//切换分支用git add . - 添加文件到暂存区。git push -- - 上传git rm -r --cached
在使用.gitignore时,有时会发现 ,部分文件无法被忽略,这种情况下可使用以下方法进行忽略操作。
执行命令将 main.go 加入不提交队列
git update-index --assume-unchanged main.go
git branch --列出本地分支
git branch (branchname) --git 创建分支
git checkout (branchname) --git 切换分支 check
git merge (branchname) --git 合并分支
git branch -d (branchname) --git 删除分支
git checkout -b (branchname) --git 新建分支,并切换到该分支工作
git checkout master --force 强制切换
git merage --no-ff 合并远程分支
本文来自博客园,作者:小珍珠在河里敲代码,转载请注明原文链接:https://www.cnblogs.com/Jansens520/p/17117272.html
 

 
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号