41
实践操作:github使用记录
source link: https://www.linuxprobe.com/github-use-records.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
在项目主页fork正式仓库
git clone 自己fork出来的仓库 git remote add upstream 添加正式仓库地址 git pull upstream master 更新本地项目(拉正式仓库的更新) git add. git commit -m "something" git push -u origin master 更新本地项目到自己仓库 pull request
代码不一致处理方法
git fetch upstream git checkout master git merge upstream/master
本地创建新分支
git checkout -b dev
关联远程分支
git branch --set-upstream-to origin/dev dev
撤销提交
git reset commitId (注:不要带--hard)到上个版本 git stash 暂存修改 git push --force 强制push,远程的最新的一次commit被删除 git stash pop 释放暂存的修改,开始修改代码 git add . -> git commit -m "massage" -> git push
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK