gthub-vsocde打开即可操作 参考文章:https://blog.csdn.net/zyx_ly/article/details/89915096
千里之行 始于切糕:https://www.cnblogs.com/kuyuecs/p/7111749.html
命令行:
git clone https://github.com/yuezhilangniao/hi-ins-four-works.git
cd hi-ins-four-works
git add readme.sh
git commit -m "master push test"
git push -u origin main
ssh -T git@github.com # 测试ssh是否成功
# 使用ssh clone链接之后 貌似可以直接push 不需要密码了
git clone git@github.com:yuezhilangniao/hi-ins-four-works.git
# 分支合并
git checkout main
git merge branchName
git status
git push
码云:https://blog.csdn.net/sui_yi123/article/details/82777811
官方入门命令:
简易的命令行入门教程:
Git 全局设置:
git config --global user.name "xinguangtipang"
git config --global user.email "5712075+xinguangtipang@user.noreply.gitee.com"
创建 git 仓库:
mkdir test_mat01
cd test_mat01
git init
touch README.md
git add README.md
git commit -m "first commit"
git remote add origin https://gitee.com/xinguangtipang/test_mat01.git
git push -u origin master
cd existing_git_repo # 已有仓库
git remote add origin https://gitee.com/xinguangtipang/test_mat01.git
git push -u origin master
已有仓库?
--------------------------------------------------------------进阶代码管理
# 第一课 commit 之后 先pull 再push ,如果远端有相同文件修改,不commint 会报错:
error: Your local changes to the following files would be overwritten by merge:
02 k8s-docker-DevOps平台/2.2 Jenkins-gitlab/Jenkins.sh
Please commit your changes or stash them before you merge.
Aborting
Updating 8435c08..2269d25
# 第二课 切糕之后的分支包含哪些文件?分支合并如何处理
# git同一文件冲突:https://blog.csdn.net/javafalcon/article/details/84789095
当同一个账号在不同设备上对同一个文件进行修改,或不同账号对同一个文件进行修改后,在git pull的时候会报告文件有冲突,解决方法如下。
1. git add .
2. git commit -m "message"
3. 提交自己的修改后,运行git pull
这时会有冲突信息:
Merge conflict in 冲突的文件名
Automatic merge failed; fix conflicts and then commit the result.
4. 根据信息提示,打开冲突的文件,然后修改。
文件中<<<<<<< HEAD到=======之间的是本地的修改,=======到>>>>>>>之间的是远程的修改。
5. git add .
6. git commit -m "message"
7. git pull
8. git push origin master
————————————————
版权声明:本文为CSDN博主「javafalcon」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/javafalcon/article/details/84789095