(FIXED) Reopen gitea PR that was accidentally closed - gitea

Is it possible to reopen a PR that was accidentally closed the branch? I think it’s because the branch marked as deleted in the PR even though I can see it in the list of branches on the code tab. When I click Edit next to the PR name I cannot select a different branch in the “pull from:” drop down.
EDIT:
I was able to force push the sha in gitea-repo/repo/refs/pull/PRNUM to the original branch. That allowed me to reopen the PR. Then I pushed the new sha.

Related

Undo the new merge request in Gitlab

I have pushed a commit by mistake to my Gitlab. How can I undo it?
Easy way is to click the revert button in the merged merge request.
Click for Reference docs
Steps to revert a merge request from UI:
Click revert button
This creates a new branch rever-some_sha.2
Either opt for a new merge request and submit that.
[ Or ]
Checkout to revert-some_sha locally, add any changes you wanted.
Create a merge request and click merge to master.
Recommendation: Do a periodical rebase of your branch to be on top of master. Which avoids any conflicts and helps to catch any failing tests before even merging your branch.
I quote rednaw:
You can revert commits with git revert . This will create
a new commit which reverts the changes of the commit you specified
with the .
Note that you only revert that specific commit, and not commits after
that. If you want to revert a range of commits, you can do it like
this:
git revert <oldest_commit_hash>..<latest_commit_hash>
Just note that this command is a little bit funny. It actually doesn't
revert the commit specified with itself, but the
commits after that until and including .
Look at the git-revert man page for more information about the git
revert command. Also look at this answer for more information about
reverting commits.
Note that this revert command also deletes the corresponding local
files
Assuming that you mistakenly created a merge request on Gitlab,
All you have to do is scroll to the bottom of the merge request page and click on the
button close merge request

TortoiseSVN, How to undo last operation?

I had a functional version of code which I was trying to commit to my local branch,
However, previously I tried to make some changes that were not accepted on that branch. So I reverted back to a previous commit.
So I was working out of a commit that was 2nd to last in the branch
Then I made some more changes, tested the program, and tried to commit again,
Then tortoise svn forced me to update, I assumed it was updating the files for the current revision I was on. But no, unfortunately, it Updated the files to the Latest commit, which I did not want, then it tried to merge my changes on top of that, so I had changes that I wanted on top of changes that I didn't want merged together!
Can I undo this and keep my changes that I just made that I wanted to commit? What did I forget to do, was I supposed to stash all of the newer commits?
Right click on file you will have option replace with choose the local history. Select the local version you want to keep.
Its done. You are good to go :)

How tortoise SVN do the Merge?Help Required

I am having a task of SVN Merge. But i am not sure hows SVN perform it.
Details:
we have Trunk & On Revision 99 we cut a branch called "code_2011".
Two different group of developer are working one on Trunk, another on branch.
Respective developer are committing their code.
Now both Trunk and branch has changed.
Now After code freeze we have Trunk on revision 200 and Branch on 299.
Now we want to merge the code on Trunk.
Both repositories are clean, now i right clicked on Trunk folder and clicked merge. but i am unable to understand the terminologies start-URl & Revision then End-URL & Revision. so that i can have final code from both repository on Trunk with all revision history stuff.
Could somebody Tell me how its done. & Is it different when i merge the from Trunk to Branch.
Thanks
It's not logically different when you merge from branch to trunk or vice-verse.
Follow these steps for merging code from branch to trunk (Basic merging)-
Checkout the working copy of the trunk (Destination, where the merge is to be done).
Right Click on the Trunk and select TortoiseSVN > Merge
select the First option "Merge a Range of revisions"
Select the Branch URL to merge from.
For Revision range to merge, click on show log. It will show you the complete change log of the branch. Select all the revision that you want to merge (Ctrl+A) for all of them and select OK.
In the next dialog box, select Test Merge. It will show you the Test merge results, you can check if there are any conflicts or the merge is clean.
Finally, Merge.
This process will merge all the branch changes in your trunk's working copy (Local checkout). You need to commit the code after that.
Also, in case of conflicts, TortoiseSVN will automatically give you option to "Edit Conflicts" to resolve them using SVN Editor or leave them so they you can manually resolve them.
Hope this helps.
Cheers!
Post the merge activity, you can also see the from-branch history in log.
There is an option at the bottom of show-log window: stop on copy/rename. Just deselect it, you will get to see all the affected revisions.

Tortoise SVN Merge: Branch->Trunk with Revision History from both Tree

we cut branch from Trunk. Changes are done on both trees and committed. Now we want to merge branch to trunk with all the revision history from both. Is it possible?
Is manual merge is different from tortoise SVN merge say i have to do 3-4 files?
"Means i manually check the changes then do it on trunk and commit the trunk."
I earlier put a question regarding it but still confused.
Experts comment only.
Thx
You should be able to merge from your branch to trunk by simply right clicking on the target branch and selecting merge. Typically, a reintegrate merge will merge all changes from a branch back into the target branch. I have had failures with that in the past based on the version of svn, how merges have been done in the past, etc. At that point, I simply would do a 'Merge revision range' without specifying a revision. It then picked up the appropriate ranges to merge and successfully pulled those over to trunk.
Once the merge is done, you must commit the merges. Simply put, the merge operation completes on your local working copy. You will then have to commit the changes to your working copy in order for others to pick it up. I recommend doing merges on clean copies of branches/targets (meaning you have no outstanding changes on either branch). Also, make sure you commit any property changes as well.
Lastly, if you just want to merge a specific change, you can specify the revision in which the change was made instead of doing a full merge/reintegration.

Merge branch with trunk

Using TortoiseSVN, I need to take changes I've done in a branch and then merge them with trunk.
I am the only developer on this project, so I know trunk hasn't changed. I am learning SVN so that eventually my team can use it.
Basically, I want my trunk to look exactly like the branch.
In pre-svn world, I would just copy the files in my branch folder, delete the files in the trunk folder, and then copy branch into trunk.
In TortoiseSVN, I've tried Reintegrate a branch, Merge a range of revisions, and Merge two different trees. Nothing seems to actually change trunk. I've also tried branching on top of the trunk. This gives me an error, saying that the trunk already exists.
In your case:
Switch the working copy to the trunk (SVN Switch)
Merge the branch into the working copy (SVN Merge)
Make sure everything still compiles and works
Commit the working copy (the trunk)
Consider killing the branch
In a team environment I would suggest that you first merge the latest modifications from the trunk in your branch, make sure that everything compiles and works, then do the above steps (which will be trivial since you've already tested the changes).
Update
In step 5, I mention killing the branch. That's because once a branch from a feature is in the trunk, it should be considered as part of the trunk. In that case the branch should be killed so that no one keeps working on it. If major modifications are needed for that feature, you should create a new branch for that.
The only branches that I don't kill are maintenance and release branches, unless a particular release is no longer supported.
No matter what, you always have access to every revision so killing a branch is only used to prevent other developers from developing on a dead branch.
I think in TortoiseSVN 1.8.5, Merge | Merge two different trees should work. When you merge a branch/tag back to trunk, the trick is that the From URL is the trunk and the To is the tag/branch. Weird but true.
Source: Merging
For directories that not in your working copy but are in the tag/branch you may get conflict errors. Just accept the conflict and redo the merge.
First switch your working copy to the trunk.
Then do a merge range of revisions, from the branch to trunk.
Once this dialog is complete the differences will be pending changes in your working copy of trunk. You'll need to commit them just as if you manually made the changes on your working copy.
In my usage, its more typical to keep trunk running and spin branches off at the times of builds. So then the only merge I ever need to do is to get a bug fix out of trunk and put it on the latest build branch and re-release that branch. The easiest way for me to do this, since as you have found merging is clumsy at best. Is to keep the latest branch and the trunk checked out to my machine, and to quite literally copy the files from trunk to branch and check both in.
I am using TortoiseSVN 1.9.3, Build 27038.
Follow below steps in order to merge branch into trunk.
1) Right click on trunk working copy and select the below option.
2) In case of Branch Merging into trunk select option second as shown below and click next
3) In the From: field enter the full folder URL of the trunk. This may sound wrong, but remember that the trunk is the start point to which you want to add the branch changes.
In the To: field enter the full folder URL of the feature branch.
4) Click next and do the test merge
5) If test merge is successful then click on Merge button.
6) Once merge is successful then commit the changes on trunk.

Resources