Have problem merging a branch - none of the changes were merged into the master - git-merge

We are still learning GITHUB. So, we try something really simple. A coworker created a branch. Then, when the code changes were ready, he created a pull request for me to review. I reviewed the changes and there were no conflict. There were a lot of changes in many files. Then, I used the "Merge and commits" button in the UI to accept the changes and tried to merge. A comment box come up and I typed in some text. The coworker received my text through email. But, then everything disappeared ! There were no error messages of any kind. The branch no longer existed and none of the changes were merged into the master. There was no record of any kind that I could find.
Is there anything that I did wrong ? (We used the free version of GITHUB.)

If you are using GitHub Desktop for accepting the PR, you would want to push your local updated laster branch after accepting the PR.
But if you were using github.col directly, the Web GUI does not have a "Merge and Commit" option. See "Merging a pull request"

Related

Is there a way to recover my code in Microsoft Visual Studio Community?

Technology used:
Microsoft Visual Studio Community 2015
VB.NET
GitHub
When i was altering skin in my form to design it, i was having trouble undoing my design to return back to its normal design. And as i go to my Form in Solution Explorer and clicked Undo everything had vanished including my code. I'm having trouble on how to retrieve my code ? Is there a way to retrieve my codes and my design or a garbage collector where i can easily retrieve it?
I would be so happy for your suggestions.I really need your Help.
The only way that you will be able to retrieve your old code at this point is if you did a
git push origin master
(or other branch) to github before you made these changes.
If you haven't use Git Extensions - I would suggest downloading and linking it to your github repo for this project. Git Extensions will give you a nice quick view of all your branches and what is sitting in your local repo.
Provided that you did a
git commit
You will still have your changes saved locally and this can be easily identified using Git Extensions.
If you have made the changes after you did a commit, you will see the old code in Git Extensions. From here you will be able to revert selected lines or all of the files. This is provided, that you had at least one major commit in git before this happened.
Update 1:
Based on your comment on your OP you should still have the original files in git. You should then be able to find your code easily via Git Extensions. You should see a list of changed files and from here you can revert them easily.
Update 2: Based on your comments, it appears that you have completely lost your changes. Git is a change tracker - and based on what you have said you did an Undo Changes on git. This means, that git had reset all the changes that it was tracking and went back to the last commit that you made. There is no way to get your changes back unless you had the files stored on DropBox or something similar where files are tracked on each save of the file. With git, changes made are only stored once committed. If you do an undo changes on the git repo before committing what it actually does is a
git reset
This removes all the changes and reverts it to the last commit.
I've checked and found this. I expect this should deal with your problem. Afterall, as long as you didn't intentionally delete anything, they are still in your target folder where you saved it.
If you checked in your code BEFORE the error on GitHub you can try this:(although I am not certain of community edition as I know it works on Pro and Enterprise).
Go to class in question
Right Click to get context menu
Select Source Control>History
Select a prior version
Right Click Reset>Reset and Delete Changes
This will basically say: "I don't care what happened just take me back to my safe place at this point in time with all affected files!". When performing code I cannot stress the importance to having source control and committing often.

Get back lost shelf changes

I have shelved my 26 java files changes via Intellij Idea 2016.2.1 and I checkout to different branch.
When I came to old branch to check my shelved changes.
I gone a mad now, I lost all the files. I was worked nearly two months
Can somebody help to get it back?
You can restore the state of those files if they were edited in IntelliJ. Use local history to see all the changes made in IntelliJ (VCS -> Local History -> Show History).
Even there isn't Shelf tab in IDE you can find shelved changes as patch files at {ProjectName}/.idea/.idea.{ProjectName}/shelf/.idea/shelf.
Then your can apply any selected patch.
I was able to view lost changes and revert back to them by:
right click on project directory, select Local History > Show History
Find the entry in the history menu that you want to restore. You can examine the files by double clicking on the entry and the files to examine differences.
Right click on the entry you want to restore, and select Revert
Note in my case Git>VCS Operations>Show History showed nothing. Only through the Project Files menu.
Andrei's answer was helpful for my situation where I renamed my project and my previously shelved changes were no longer found under the shelf, but I did run into an issue when applying the patch file because I was prompted to "Select missing base" for various files in the patch. Similar to what is seen in the screenshot below:
https://youtrack.jetbrains.com/issue/IDEA-183910
I was able to avoid having to "Select missing base" for various files by first changing the default shelf location and then applying the patch.
https://www.jetbrains.com/help/idea/shelving-and-unshelving-changes.html#change-shelve-location
Also, I found my patch in this location:
{ProjectName}/.idea/shelf
instead of the aforementioned location:
{ProjectName}/.idea/.idea.{ProjectName}/shelf/.idea/shelf
Maybe this will help someone:
I lost part of my shelved changes in combination with an update of IntelliJ. I'm not sure if the update was the reason but eventually most of my most recent (and important) changes were gone.
I couldn't restore them from local history as this does not "survive" an update of IDEA. But in the files I saw that there still is some data:
C:\Users\myUser\AppData\Local\JetBrains\IntelliJIdea2021.2\LocalHistory had a changes.storageData with ~50MB.
Copying the files to the folder of the new version didn't help as the files got overwritten again.
Solution:
I was able to get the old version of IntelliJ (2021.2) here and installed it. This can be done in parallel, without removing the newer version.
Here I was able to retrieve my changes from the Local History and shelve or apply them again.
Hint: Backup the "Local History" folder (or the whole IntelliJIdea20xx.x folder) before you start. I don't remember if I had to copy it in there again or if it worked out of the box. (Just to be sure the local history doesn't get lost).
I've also experienced this bug repeatedly and hence no longer use shelved changes, but rather the Git CLI directly. As of 2022 Jetbrains IDE's still cannot be trusted with their "Smart Checkout" feature, which has a small probability of the total loss of your files (experienced personally in both IntelliJ & Rider).
Unlike another comment here regarding using the Local History, this did not work for me as the history showed nothing. I've also lost many hours of work due to this bug which remains unfixed.
The solution is to use "git stash -u" on the command line, then checkout the desired commit. Once youre done, type "git stash apply" to restore your files. Trusting the "smart checkout" feature is like playing Russian roullette. It's IDE magic that may just fail and you lose everything.

How to remove a repository from Launchpad?

Specifically I have a repository setup in Launchpad. I need to remove this repository but didn't find any link to do that from launchpad website. I am wondering whether I could do it on my local branch using "bzr". Or I am missing something from the launchpad website to remove it.
To have your entire project deleted from Launchpad, you have to post a "question" on this page:
https://answers.launchpad.net/launchpad/+addquestion
Yeah it's weird. But this seems to be the official way. If you search for the keywords "delete project" on this page you will find many many similar requests:
https://answers.launchpad.net/launchpad
Make sure to include a detailed explanation why you want to do this and that you are aware of the consequences. Otherwise you will get a response along the lines "the community might still use the source code you want to delete" and so on.
Of course they are right, and you should carefully consider whether you really want to remove code that other folks might be using and linking to.
If you are sure you want the project gone, then you can reduce the turnaround time with the Launchpad team by first deleting all your branches. You might not be able to delete the trunk, in that case you can try to force-overwrite it with an empty branch, using these steps:
bzr init empty
cd empty
touch empty.txt
bzr add
bzr commit -m 'dummy commit'
bzr push lp:PROJECT --overwrite
Of course, replace PROJECT with the name of your project. All these steps are necessary to empty the branch. You cannot simply push an empty branch, Bazaar will tell you that No new revisions or tags to push. and the branch will be untouched. You need a completely new revision, like the dummy revision in this example.
If your project has no meaningful source code in it, the Launchpad team should not have any objections to delete it, so you can reduce the turnaround time.

Bazaar Explorer hangs when parent branch is unreachable

I created a shared repository on my laptop. In that repository, I created a branch named trunk. Then I created an unbound branch of trunk on my desktop so I could do work on either machine and sync my changes manually.
This works pretty well except for one nagging issue. On my desktop, Bazaar Explorer is forever trying to reach the remote branch. Every time I hit Refresh (for example) Bazaar Explorer hangs for several seconds while it does ... something. If my laptop isn't on the network, Bazaar Explorer hangs for even longer and then displays the error message, "Not a branch: <branch URL>". Afterward, I can proceed as normal.
One of the reasons I switched to a DVCS from Subversion is that you can keep on working and commiting even when "the server is down". Technically, I can keep working, but the constant freezing is killing it for me. Is there a solution?
Edit .bzr/branch/branch.conf and remove the line with parent_location = ....
Note: later if you merge or pull from another branch, it will again save the parent_location. To prevent it from doing that, add the --no-remember flag when you merge or pull.
As #bialix pointed out in a comment:
if you want to disable remembering of parent_location you can also edit branch.conf and put there: parent_location = that is nothing (or space) after equal sign.

Accurev - why not Auto-Update?

Why isn't it standard behavior for Accurev to automatically run an "Update" upon opening the program? "Update" updates a user's local sandbox with the latest files from the building/promoted area.
It seems like expected functionality that the most recent files should be synchronized first.
I'm not claiming that it should always update, but curious as to why an auto-Update wouldn't be correct.
Auto-updating could produce some very unwanted results.
Take this scenario: you're in the middle of a development task, but you've made a mistake and need to revert a file that you just modified. So you open AccuRev, but before you have a chance to "revert to most recent version", you are bombarded with 100 files that have been changed upstream including the one you want to revert. You are now forced into the position of resolving all the merge conflicts before your solution will build, including the merge of your (possibly unstable) code in progress.
Requiring the user to manually update keeps a protective 'bubble' around the developer, allowing them to commit (keep) changes within their own workspace without bringing down code changes that could destabilise the work in their sandbox. When the developer gets to a point where his code is ready to share with others, that is the appropriate time to do an update and subsequently build/retest the merged codebase before promoting.
However there is one scenario that I do believe auto-updating could be useful: after a workspace is reparented. i.e. when a developer's workspace is moved from one part of the stream hierarchy to another. Every time we reparent we have to do a little dance:
Accept the confirmation dialog that reminds us (rather verbosely) that we need to update our workspace before we can promote any changes.
Double-click the workspace to view its files.
Wait for AccuRev to do a "Pending" search, to determine whether any file changes are waiting to be committed.
And finally, perform the Update.
Instead of just giving us a confirmation dialog, it would be nice if AccuRev could just ask us if we want to Update immediately.
I guess it depends on preference. I for one wouldn't like the auto-update feature.
Imagine you have a huge project and you don't want to build it every time you start Accurev. But you also can't debug because the source files and debugging info no longer correspond.