1.在github新建一个空白仓库
2.进入项目的文件夹打开git 命令端
右键选择git Bash here
3.
git init #初始化
4.
git remote add origin (address) # 添加远程仓库地址
5.
git add . # “.” 表示添加本地所有代码
6.
git commit -m “init” # 添加这次提交的备注信息
7.
git push origin master # 提交到远程仓库
过程中要登陆github账户,关联github账户到git
1.将所有变更文件添加进来
git add .
2.提交变更信息
git commit -m ‘20220523_3’
3.抓取并合并远程仓库全部内容
git pull origin main
如果报错,就要挂
4.推送本地仓库数据
git push origin main
2.切换到新分支
命令如下:git checkout [分支名称]
例如:git checkout dev
4.提交本地代码
命令如下:git commit -m “修改说明”
5.push到git仓库
命令如下:git push origin [分支名称]
例如:git push origin dev
Merge branch ‘main’ of https://github.com/1120026847/DataSet
Please enter a commit message to explain why this merge is necessary,
especially if it merges an updated upstream into a topic branch.
Lines starting with ‘#’ will be ignored, and an empty message aborts
the commit.
不写原因直接3,4步骤,写原因则1,2,3,4步骤
1.按键盘字母 i 进入insert模式
2.修改最上面那行黄色合并信息,可以不修改
3.按键盘左上角"Esc"
4.输入":wq",注意是冒号+wq,按回车键即可
fatal: unable to access ‘https://github.com/1120026847/DataSet.git/’: OpenSSL SSL_connect: Connection was reset in connection to github.com:443
开启,在项目下的git目录的命令提示符输入以下命令
git config --global http.proxy 127.0.0.1:10809
git config --global https.proxy 127.0.0.1:10809
git切换分支报错:error: pathspec ‘dev‘ did not match any file(s) known to git.
git fetch(取回所有更新分支信息)
git branch -a(此时可以查看到dev分支)
git checkout dev
Git 常见错误 之 error: src refspec xxx does not match any / error: failed to push some refs to 简单解决方法
【已解决】OpenSSL SSL_connect: Connection was reset in connection to github.com:443
Git的使用–如何将本地项目上传到Github(三种简单、方便的方法)(二)(详解)
二次提交Git时操作
git出现这种错误是什么原因?error :hint?
修改文件后,使用git提交到github
【Git】合并分支出现 Please enter a commit message to explain why this merge is necessary.
怎么解决 fatal: destination path . already exists and is not an empty directory.?
Git提交本地代码至分支
git切换分支报错:error: pathspec ‘dev‘ did not match any file(s) known to git.