1、下载安装
git官网下载安装,一直下一步。
2、链接github
**重点:**获取token 拿到token,在连接运程github用来进行身份认证的,十分简便
3、idea集成
4、代码版本控制
新建一个文件夹: git clone 远程仓库链接 .git里就已经有了远程仓库的信息。如地址,分支等不用再git init git push 可直接上传代码到该仓库。 git status 查看文件的几个状态。
git add . git add --all 将文件加入暂存区,文件就被跟踪了,文件状态发生改变。(这两个指令区别第二个添加的能被修改,没有测试过)
git commit -m "这里是这次将暂存区提交到本地仓库的说明" 暂存区文件被提交到本地的仓库里
git status 查看文件状态,发现暂存区变空,无文件被标记
git push 将本地仓库提交到远程github仓库。
----------------------------------------------------------下面是github建立新仓库无代码状态的指引 Quick setup — if you’ve done this kind of thing before or https://github.com/crorylove/study.git Get started by creating a new file or uploading an existing file. We recommend every repository include a README, LICENSE, and .gitignore.
…or create a new repository on the command line echo “# study” >> README.md git init git add README.md git commit -m “first commit” git branch -M main git remote add origin https://github.com/crorylove/study.git git push -u origin main …or push an existing repository from the command line git remote add origin https://github.com/crorylove/study.git git branch -M main git push -u origin main …or import code from another repository You can initialize this repository with code from a Subversion, Mercurial, or TFS project.
|