Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Steps 10&11 for cleaning and updating remote and local repos #202

Open
sankaest opened this issue May 23, 2022 · 1 comment
Open

Steps 10&11 for cleaning and updating remote and local repos #202

sankaest opened this issue May 23, 2022 · 1 comment
Labels
type:docs Documentation

Comments

@sankaest
Copy link
Contributor

I am really thankful for this tool, what definitely simplify help in development of Yii3 for those who are not so familiar with git concept and working in a big team.

But it would help a lot if additional steps will be added or at least some words in readme file, if those steps are not needed:
Step 10. Clean up after pull-request is merged.
As I understand, branch is not needed any more after PR is merged. While trying to delete the branch (from dev/...):
git branch -d branch-name-to-be-deleted
I get response:

error: The branch 'branch-name-to-be-deleted' is not fully merged.
If you are sure you want to delete it, run 'git branch -D branch-name-to-be-deleted' 

What is wrong? Some web sites suggest to make: git remote prune origin, but result is the same.

Step 11. Updating remote and local repositories after PR is merged
Another question I could not find an answer. Is it needed to update remote and local repositories? If I am working on new feature and create new branch, it has to be hand-in-hand with main repository? How will I update remote and local repositories?

I would be very appreciated if someone could clarify those steps and write some git code, what shall I run directly in dev/... repository. Otherwise next branch will be a nightmare for me.

@samdark samdark added the type:docs Documentation label May 23, 2022
@xepozz
Copy link
Member

xepozz commented May 23, 2022

About branch deleting
I ask for git branch --help and see the text:

With a -d or -D option, <branchname> will be deleted. You may specify
more than one branch for deletion. If the branch currently has a reflog
then the reflog will also be deleted.

...

-d, --delete
Delete a branch. The branch must be fully merged in its upstream
branch, or in HEAD if no upstream was set with --track or --set-upstream-to.

-D
Shortcut for --delete --force.

So you get The branch 'branch-name-to-be-deleted' is not fully merged. reasonably.
And the solution for you is git branch -D branch-name-to-be-deleted, as git said to you.

About sync

Usual commands to sync repos:

  • git fetch
  • git pull

If you want to get changes from main branch into yours, you can do git pull origin main-remote-branch-name:main-local-branch-name after the remote repo had been configured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:docs Documentation
Projects
None yet
Development

No branches or pull requests

3 participants