[英]Need advise about working with remote git repo
I have git situation like below and im new to git too :我有如下 git 情况,我也是 git 新手:
What should i do if i have to create new branch (ex:A02) to implement new feature In my thinking there are 2 options :如果我必须创建新分支(例如:A02)来实现新功能,我该怎么办在我看来,有两个选项:
Please advise, appreciate your help.请指教,感谢您的帮助。
I do made some changes in Projects file but for local environment only (not pushed)
我确实在项目文件中做了一些更改,但仅适用于本地环境(未推送)
What you need to do depends on what you want to do with your local changes.您需要做什么取决于您想对本地更改做什么。
git stash
.git stash
。 This will clear your working tree and index tree in your repogit pull
.git pull
。 It should complete successfully.git stash apply
.git stash apply
。 Remember, you might get merge conflict while applying it back.git pull
.git pull
。 You might get merge conflict, you need to resolve them. One option is to create a new branch to track your local changes.一种选择是创建一个新分支来跟踪您的本地更改。
git checkout -b <new branch name>
git checkout -b <new branch name>
git checkout develop
git pull
git checkout <new branch name>
git checkout <new branch name>
Another option,另外一个选项,
git checkout -b A02 origin/develop
(Assuming your remote repo name uses the default name, origin.)git checkout -b A02 origin/develop
(假设您的远程仓库名称使用默认名称 origin。)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.