Can't get latest updates - c#

I using Git with Bitbucket - every time when I have this issues I deleted my files from local PC and copied it from bitbucket. I think it isn't good idea do it every time.
What happened: usually for correct work I did next step - update my branch for last version and after that I commited my updates in my Branch. Before I got this problem - I didn't get latest updatets, because someone did several changes in my Branch without me. As result I tried to commit changes from my PC and couldn't do it.
Now I wanna delete outgoing commit and try to get update, how can I do it? (I tried do: click on my commit->Reset->Reset and delete changes (nothing happens)/ and I tried: action-> view history->find my commit and click on a reset ->Delete changes(nothing happens)).How can i delete outgoing commit?

Related

TFS Replace Everything

I JUST want to get the latest version of a C# project on TFS and replace everything, it doesn't matter what I did on the code.
I'd Like to delete all the stuff and restart again as the way it is on the server.
Other solutions even simplier ARE NOT interesting for me.
JUST THIS ONE.
Thanks since now.
In my answer i will discuss 2 ways to get rid of the changes you made and reset back to what is in the code repo. First is the way to reset all files at once. The second method is how to do 1 single file if that is all that is needed.
METHOD 1, ALL FILES AT ONCE:
Click the Home button on the Team Explorer and see this screen:
Then click Branches to see this screen:
Then right-click the branch you want to revert your local code to and select Reset and then Delete Changes (--hard):
METHOD 2, Single file at a time:
Now you may want to just revert a single file and this is done by doing the following:
Click Home button on your Team Explorer and see this page:
Then click Changes and see this screen:
Then right-click any of the files you have listed there and select Undo Changes...

Jquery still running the previous code and ignoring changes

I have a .js file that whatever changes I do (I even delete all the codes) it doesn't recognize or run the new changes, it just run the last code I saved days ago.
Here is what I did before encountering this problem.
I made a copy of my project and save it in different folder(location) and now I deleted the original and used the copied one. I made some changes on the .js file but doesn't run the new changes. Anyone know the solution to this?
I tried cleaning and building the solution but it doesn't work.
Sounds like a caching problem, did you try reloading without cache or doing a "hard reload"?
Open devtools (F12), right click the refresh button then press "Empty Cache and Hard Reload".

libgit2sharp get next version changes

Using the code from this answer I can checkout a specific version of the codebase just fine.
How do I get a previous version of a file with libgit2sharp
I then further want to get the next version after that. I get an error when getting the next version.
19691 conflicts prevent checkout
What is the best way to get the changes from the next version into the same directory ? Perhaps do a get first to a temp directory and then copy replace over the first, is there a better way ?
What I ended up doing is to get code using the answer from this question.
How do I get a previous version of a file with libgit2sharp
Then do a diff in the main repository to figure out the changed files for the next commit. With that list I can get only the changed or added files and remove deleted files from the first get. This works pretty fast when dealing with repositories with a lot of files in them.

synchronization between branches in visual studio 2015 and in web

it's clear when you see this pics. sorry im not good at eng. so it's a little bit hard to understand what i write it here.
git branches in website and branches in team Explorer of VS2015 aren't synchronized. aint same.
BECAUSE
we two person are working together. my remotes/origin in VS and branch in web was same at first. The problem happens when after below story.
I changed code in hotfix-2.0.0.a branch in local and clicked the Synchronization section in VS and 'pushed' my commits to remote. and clicked the 'Sync' button. (I thought that I did send commits I've done of remotes\origin in local to xxx.visualstudio.com)
I made a 'pull request' in the web. (hotfix-2.0.0.a to develop and Release)
we 'approved' and 'completed' in the web.(I think 'complete' let automatically merged to branch I selected)
As you know, branches hotfix-2.0.0 was deleted. and He who is my coworker deleted branches that Hotfix, Feature. He said I made them wrong. these are useless.
summary: he deleted Feature, Hotfix, hotfix-2.0.0.a(merged and deleted) in web.
but my branches remotes/origin in VS in local didn't get updated from web. cuz there are still remained in my remotes/origin that is shown.
I deldeted them in local then VS said
"푸시하는 동안 다음 오류가 보고되었습니다.(means error occured while pushing)
refs/heads/hotfix-2.0.0.a, TF401027: Your identity (Windows Live ID\xx#xx.xx.kr) doesn't have the Git 'ForcePush' permission for the current branch, which you need for the action you just tried. Contact your administrator for help."
But I don't want ForcePush. just want to sync with view in web.
could you guys tell me how can i solve it?
thx for read it. thx a lot.
git branches in team Explorer of VS2015
this first pic's point spot i want to show you is remotes/origin.
git branches in website
in this sencond pic, there are 4 branches.
now first pic there are 7 remote repo, and second pic there are 4 remote repo.
Coworker deleted some branches or merged in website. but remotes/origin/branches doesn't show these changes. Is there any way to synchronize between remotes/origin in local and in web about changes of branches?
"Push branch" to push local branch to the remote
"Fetch" or "Checkout" to fetch/checkout the branches from the remote repo
For branches Feature, Hotfix,hotfix-2.0, you can delete them by this way:
In Sync, click fetch.
In Branches, delete these branches (Feature, Hotfix,hotfix-2.0) in remotes/origin: select a branch in remotes/origin -> right click -> delete branch from remote.
In branches, delete the local branches (Feature, Hotfix,hotfix-2.0, feature-2.0.5): select a branch –> right click -> Delete.
I finally resolved this problem. I've tried to fetch, and push but it doesn't work. However when I click the 'sync' in Synchronization tab in team explorer, I can delete the branch in Branch tab in team explorer which was already deleted in the web site.
Thx all of guys.

Remove some commits in GIT

I am new to Git, although I just managed to change file in my previous commit.
First commit in redbox let's call it R1 is the one with commited password. I made it accidentally, so I wanted to make change - just change the file where that password was. I managed to do it successfully, not from the first time.
So I the commits the "path" to my head - last commit is the green box. These commits are same as the red one, but without the password.
So everything is as I wanted it to be, but I want to remove the 3 commits that are in a red box, cause password is still there.
Can you tell me how to do it?
I understand that this might be a duplicate, but I have a picture so maybe it will help to understand better.
It looks like what you may be looking for is $ git rebase -i which will bring up the interactive mode for rebasing your commits. In interactive mode you can edit, squash, discard previous commits. This is a previous discussion about using interactive rebasing. source
This should be enough to help you clear away the previous commits that contain the details that shouldn't be public.
In the future you can create a .gitignore file that will tell git to ignore certain files, which helps greatly with privacy and security issues. You can find more about .gitignore files here.
In the future if this occurs you can easily erase a commit by using git reset --hard HEAD~1 which will bring you back to the commit before the head.
You can use git log at any time to find a specific id of a commit that you want to jump back to with git reset --hard <sha1-commit-id>, but be advised this will delete the changes at your local working level.

Categories