尧图网络 高端网站定制 · 原创设计
免费咨询热线
400-888-6620
免费获取方案
GIT Manual
Git Github應用示例客戶端切換不同用戶使用说明從git全新pull一個新項目修改eclipse 的 tokengithub 生产token事先pullpush后synch创建Project本地初始化查看当前文件夹下的文件管理状态把所有的文件添加到本地仓库管理界面更改Branch把本地文件push到服务器的另一个分支最简单的一次提交$ git status$ git add .$ git commit -m log$ git pushGIT Command安装查看版本查看git安装路径查看、切換目錄查看所有本地分支查看本地和远程跟踪分支檢出並創建projecteclipse import project重命名切換brancher创建branch切换branch創建并切换到brancher删除本地分支合併提交新Brancher合併查看project狀態與remote repository差異贮藏与清理 ([TODO]pop [Stashing and Cleaning]清屏git branch --unset-upstream 刪除跟踪信息git push --set-upstream origin master建立追蹤TrackLocal to Remote修改登錄賬戶Github 客户端Eclipse修改URL修改password從服務器全部替換本地VS studio應用示例客戶端切換不同用戶列出當前用戶$ git credential-manager github list abcboobook退出當前用戶$ git credential-manager github logout abcboobook檢出Coding$ git clonehttps://github.com/wesoftwabdsdcnd.git跳轉到Github的登錄頁進行驗證。#GIT Create Project使用说明從git全新pull一個新項目初始化本地 $ git init 查看本地映射的遠程分支如果之前沒有pull第一次為空 $ git remote -v $ git remote add originhttps://github.com/abc.git $ git pull origin dev修改eclipse 的 tokengithub 生产tokenSettings/Developer Settings/Personal access tokens (classic)事先pullpush后synch因为IDE的git工具只比较最新修改和最后一次pull的版本每次push或者commit前需要解决冲突所以要把服务器上最新版本pull下来本地解决冲突然后再commit。commit后一定要synch或者服务器上的最新版本。为什么一定要synch防止解决本地冲突的时候不是和最新版本进行比较这样即使解决冲突push上去也不是最新版本。synch可以保证本地与服务器同步。即使提交之前pull到最新版本但是在解决冲突的过程中有其他人也会push。所以push之后的synch非常重要。创建Project本地初始化把当前文件夹变成Git仓库成功后多一个git文件夹但是.gitignore是maven的文件。$ git init Initialized empty Git repository inD:/workspace/javaspace/erp/.git/查看当前文件夹下的文件管理状态untrcked files显示所有不受git管理的文件。$ git status On branch master No commits yet Untrackedfiles:(usegit add file...to include in what will be committed).gitignore .mvn/ mvnw mvnw.cmd pom.xml src/ nothing added to commit but untracked files present(usegit addto track)把所有的文件添加到本地仓库$ git add .$ git commit -mthis is frist commit脚本如下echo# openerp README.md git init git add README.md git commit -mfirst commitgit branch -M main git remote add originhttps://github.com/develperofbamboobook/openproject.git git push -u origin main管理界面更改Branch把本地文件push到服务器的另一个分支先切换到提交的目录下 $ git checkout master 如果當前分支與多個主機存在追蹤關係則可以使用-u選項指定一個默認主機這樣後麵就可以不加任何參數使用git push。 $ git push -u origin master最简单的一次提交在本分支下提交$ git status参考下文件状态$ git add .提交所有$ git commit -m ‘log’写备注并提交到本地库$ git push提交到服务器GIT CommandDistributed Version Control System分布式版本控制系统Such as Git、Mercurial、Bazaar、Darcs。镜像客户端并提取最新版本的快照把代码仓库完整地镜像下来。如果服务器发生故障可以通過任何一个镜像出来的本地仓库恢复。安装Download for Windows。从源码进行安装C:\winget install--id Git.Git-e--source winget 已找到 Git[Git.Git]版本2.37.3此应用程序由其所有者授权给你。 ██████████████████████████████47.0MB/47.0MB 已成功验证安装程序哈希 正在启动程序包安装...已成功安装查看版本PS C:\git--version git version2.32.0.windows.2或者 C:\git-v git version2.37.3.windows.1查看git安装路径C:\Windows\system32where git D:\codetool\git\git.exe查看、切換目錄$ cd .. $ pwd查看所有本地分支并输出最后一次提交备注$ git branch -v dev bb059b0 first commit * master bb059b0 first commit查看本地和远程跟踪分支输出显示了存储库中的所有本地和远程跟踪分支名称$gitbranch-amaster*testremotes/origin/master$gitbranchmaster*test$gitbranch-v-vmastercff658a[origin/master]按版本管理*testcff658a[origin/master]按版本管理檢出並創建project默認master branch全部檢出本地切換$gitclone#giturl2.檢出指定branch其它branch在本地被Trackgitclone--branchbranchnameremote-repo-urlorgitclone-bbranchnameremote-repo-url#例如gitclone-bdevhttps://github.com/your/repo.git3.檢出指定branch其它branch不被Trackgitclone--branchbranchname--single-branchremote-repo-urlorgitclone-bbranchname--single-branchremote-repo-urleclipse import project重命名git branch -m 和 git branch -M 是用来移动和重命名分支的。 类似 -c 参数对于参数 -m其只会在目标不存在的时候进行移动和重命名-M 参数则不管目标是否存在都会移动和重命名。 -m -f 可以实现和 -M 相同的效果。git checkout test //把test分支改成newtest git branch -m newtest git branch # * dev # master # newtest切換brancher在project的目錄下切換brancher$cd*rap*d$gitcheckoutdevelopSwitchedtoanewbranchdevelopBranchdevelopsetuptotrackremotebranchdevelopfromorigin或者git switch branch name创建branch$ git branch master切换branch$ git checkout master Switched to branchmaster創建并切换到brancher##在本地創建push時在遠程創建$gitcheckout-btest删除本地分支不能在Branch test 下刪除必須切換到其它目錄如master目錄$gitbranch-dtestDeletedbranchtest(wascff658a).gitbranch-Dbranch_name#強制刪除合併提交新Brancher合併$gitmergedevelop#LocalRepositorygitpush--set-upstreamorigintest查看project狀態與remote repository差異$gitstatus$gitpull#下載服務器端fileor$gitfetchv1.8.4later贮藏与清理 ([TODO]TODO$gitstashpop [Stashing and Cleaning]TODO清屏$cleargit branch --unset-upstream 刪除跟踪信息Git告诉您可以使用删除跟踪信息–unset-upstream。这将清除branch.source.origin和branch.source.merge并停止警告。$gitstatusOnbranchmasterYourbranchisbasedonorigin/master,buttheupstreamisgone.(usegit branch --unset-upstreamtofixup)git push --set-upstream origin master提交並在遠程創建master branch$gitpush--set-upstreamoriginmasterEverythingup-to-dateBranchmastersetuptotrackremotebranchmasterfromorigin.建立追蹤TrackLocal to Remote本地庫與遠程庫的對應關係即遙控器$gitbranch--set-upstream-toorigin/masterBranchtestsetuptotrackremotebranchmasterfromorigin.修改登錄賬戶remote: HTTP Basic: Access denied置空後重新設置Git客戶端的賬號$gitconfig--system--unsetcredential.helperGithub 客户端Focus on what matters instead of fighting with Git. Whether you’re new to Git or a seasoned user, GitHub Desktop simplifies your development workflow.Eclipse修改URL修改password右鍵項目選擇team從服務器全部替換本地VS studioPlease clean your repository working tree before checkout
RELATED

相关推荐

react源码学习笔记

react源码学习笔记

1、virtual domReactNode分为以下几类React$Element:其属性有export type ReactElement {$$typeof: any,type: any,key: any,ref: any,props: any,// __DEV__ or for string refs_owner: any,// __DEV___store: {validated: 0 | 1 | 2, ...}, // 0: not validated,…

📅 2026/10/14 1:44:56
Cartographer实战指南:环境配置、TF坐标系与建图参数调优

Cartographer实战指南:环境配置、TF坐标系与建图参数调优

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

📅 2026/10/14 1:39:56
高清摄像机测试方法详解:从MTF50到动态范围的工程化验证

高清摄像机测试方法详解:从MTF50到动态范围的工程化验证

简介:《高清摄像机测试方法》是一份面向安防监控、视频设备研发与质检人员的高清摄像机性能评估资料,源自公共安全行业标准征求意见稿,系统解决了测试条件、测量仪器和量化指标不统一的问题。压缩包内为单个DOC文档,体积约1.37MB&…

📅 2026/10/14 1:39:56
MORE NEWS

更多资讯

📰

如何在windows11禁止ollama开机启动

如何在windows11禁止ollama开机启动 在 Windows 11 上禁止 Ollama 开机自动启动,操作起来并不复杂。由于 Ollama 安装后默认会设置开机自启,但并没有提供直接的图形化开关,因此我们需要通过系统自带的功能来管理它。 删除启动文件夹快捷方式 …

📰

Kali Linux入门必看:3天速成网络安全基础,小白也能轻松上手!收藏起来学!

Kali Linux入门必看:3天速成网络安全基础,小白也能轻松上手!收藏起来学! 本文针对网络安全初学者在Kali Linux上遇到的常见问题,如安装、命令理解、工具使用等,提供了实用的入门指南。文章强调初学者无需一…

📰

SQL注入实战:低权限服务账户下如何以内网跳板实现C2上线(收藏必备)

SQL注入实战:低权限服务账户下如何以内网跳板实现C2上线(收藏必备) 本文通过实战案例,展示了在MSSQL注入中,当xp_cmdshell仅以低权限服务账户执行时,如何利用注入点作为内网跳板。通过堆叠查询&#xff0c…

📰

2026年AI安全上市公司梳理:产品、认证与商业化进展

随着大模型和智能体逐步进入企业业务流程,网络安全企业面临两类新需求:一是防范提示词注入、敏感数据泄露、模型输出风险等AI应用安全问题;二是利用AI提升威胁分析、告警研判和安全运营效率。因此,分析网络安全AI概念股&#xff0…

📰

PLC数据处理指令详解:从传送比较到移位转换的实战应用

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

📰

DeepSeek私有化部署全攻略:SpringBoot集成与语音图片交互实战

最近一直在折腾大模型私有化部署这件事,从年初开始陆续把几个开源模型搬到内网试过,踩了不少坑,也总结出一套比较顺手的链路。这篇就完整聊聊“私有化部署DeepSeek SpringBoot集成 带语音和图片的UI交互”整条路线,给正准备把大…

TODAY

今日更新

THIS WEEK

本周精选

THIS MONTH

本月热门

读完文章,想聊聊您的网站?

告诉我们您的行业与需求,资深顾问一对一梳理方案与报价,全程免费。

📞 💬