Mercurial bookmark delete does not propagate - version-control

I have a bookmark which is already synchronized with the remote server. Several colleagues have clones of that repository including the bookmark.
I am deleting and pushing the bookmark with the following commands:
$hg bookmarks --delete myBookmark
$hg push -B myBookmark
I am checking if the bookmark still exists on the remote server, and it doesn't:
$hg incoming -B
searching for changed bookmarks
no changed bookmarks found
So, all in all it seems that the bookmark has been deleted. Still, my colleagues, after pulling, they still have the bookmark. It's true that it does not move forward with my future pushes to default branch, but it still exist. I guess that they also have to run the command hg bookmarks --delete myBookmark in order to get rid of it.
Is this normal behavior, or am I doing something wrong?
Thanks.

Is this normal behavior, or am I doing something wrong?
Yes, this is normal. Your colleagues' bookmarks will not be pushed back to the server unless they request it (with hg push -B), but neither will the server's lack-of-a-bookmark get pulled. This is a Good Thing, because your colleagues may still be using the bookmark even if you aren't.

Related

Accidently deleted every file in Vs Code while trying to push to git, any way to recover them?

I am a complete noob so while trying to deploy one of my programs to heroku, I needed to push it to github, in Vscode while trying to do that, I got a whole bunch of files that I didn't want to upload on github, so I hit remove all from this screen
I now realize that I deleted everything and I don't know what I can do, I tried going into my drive and hitting properties to try and restore but looks like I hadn't turned that feature on. Is there anyway I can recover my files? I am on windows
Simply go to your terminal and navigate to the folder you are pushing to git. You can run these commands:
git log --pretty=oneline (Shows all previous commits)
git checkout . (This resets everything to the previous commit)
Once you have reset your project to the previous commit, try again and delete the files you wanted to remove. Then perform the git commit -am "text here" and git push heroku master commands.
EDIT: This only works if you have already made git commits. If you have deleted everything and git log --pretty=oneline does not show any commits, then there is no way to recover the deleted files.
You can also check the recycle bin of your computer to see if the deleted files are there.

How to view file changes before pulling through GitHub on RStudio?

I'm transitioning from using Subversion in Eclipse for code management to GitHub in RStudio. It's starting to make sense, but I can't seem to figure out how to pull effectively.
Specifically, if I use the Pull arrow in RStudio, every file change in the repository automatically updates my local files without warning. I can see how many files were updated, but not what changed!
Here are the questions I'm hoping to get help with:
1) Can I preview the repository file changes in RStudio before I pull them locally? With SVN in Eclipse, there was an indicator showing files with a difference, and the option to view side by side.
2) If multiple files have been changed on the repository, is it possible to pull just 1 locally?
3) How can I revert a local file to a previous version?
Right now I've been trying to do this all within RStudio for simplicity. I haven't used things like the GitHub desktop client.
I appreciate the help!
I would suggest you better get used to the git's own tools to stay informed about your repository.
For example you could do following.
Before you pull, check your current commit logs
git log
This should show you how your current commits stack up. Note the latest commit id (first 4-5 letters would usually do)
Now after pulling you can see the difference using following command
git diff --color your_previous_commit_id..HEAD
If you don't like the changes and want to go back,
you can just reset to your favorite commit with following command. BTW run "git stash save" to keep a copy of your uncommitted changes.
git reset --hard you_favorite_commit_id
Note: that this will delete all your uncommitted changes unless you stashed them and put your local branch behind the remote repo branch you are tracking again.
Wondering where to put these commands? Check https://git-scm.com/downloads.
What's good about using these git tools is that if you switch between IDEs you don't need to search for same functionalities you had in your earlier IDEs.

Instead of Committing Files, I hit 'Sync' in GitHub app

Which Git then proceeded to sync (overwrite) files from my repository (not github), to my local files. I have lost an entire day or more of work.
Is there a way to revert what happened? What did happen?
I am side myself.
Rich
If the application stashed the changes instead of removing them you will be able to restore it. Try this:
git stash list
Hopefully you'll get an output stash#{0}: ..., which should be easily restored with:
git stash apply
However if there is more than one stash you'll need to call:
git stash apply stash#{number}
If it's more complicated, look into docs for stashing.
Note that if there's no stash, the uncommited changes are gone. Forever. If you don't have an editor that preserves changes or has some backups then I don't think there's anything you can do.

How to just get remote changes for a specific file?

There is a conflict on a file but it's ok, I just like to take the edits done remotely.
So, I choosed "overwrite" and at the question "do you want to overwrite local changes?" I said "yes" and I can see that my local file was overwritten.
Problem is that egit keeps telling me about the conflict, but there is no conflict anymore!!!
And now I am stuck because if I try to commit my last changes (which are for different files) I get a "non fast forward" error...is git idiot or I am missing something?
First you need to rebase the code to the remote one. Then apply your changes to that. Then you can push the changes to the remote server.

Git reset gives me "still trying to merge"

I've googled this in many different ways and can't find anyone else talking about it (at least as far as I understand).
On my office pc I was trying to find a solution to a problem I was having (so I was ahead of my remote git repo, but without committing).
That night at home I figured out the solution and pushed it to my remote repo from my home pc.
Now I'm back in work and I wanted to reset my local repo on my office pc to match the remote (and discard all my local changes).
I ran:
git reset --hard origin/branch1
I got:
HEAD is now at 1501f25 **Still trying to merge**
What does this mean?
'Still trying to merge' seems to indicate it didn't complete somehow, but I can't see how (and I'm having no luck finding a clear answer in the git docs).
If a git merge --abort (git1.7.4+, January 2011) doesn't do it, check if you still have a .git/MERGE_HEAD file (and delete it).
Then the git reset should proceed (or, since it completed, the git repo state should be coherent).
Make sure you are in the right branch you wanted to reset to origin/branch1.
As the OP Roy Collings suggests, recloning should get rid of the warning, but that means having one's project config files versioned in order to minimize the time spent to configure everything again in a new cloned repo.
Since relative paths are supported in an Eclipse config, having .project and .classpath in a git repo is possible.