synchronization between branches in visual studio 2015 and in web - c#

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.

Related

Can't get latest updates

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?

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...

Does a simple solution exist for programmatically detecting add/edit/deletes locally and updating visual studio online accordingly?

I have code that generates SQL scripts that will run nightly. I want to check this into source control each night, so I get a history of changes to tables etc. as well as picking up new tables and when tables are deleted.
I have a team project created in Visual Studio Online.
From looking online it looks like there's no reliable way of automatically picking up changes locally and committing them to VSO. I'd have to create something that compares what I have locally to what is in VSO, which to me seems error-prone.
If I use the command line utility it looks like I have to tell it what is added and deleted (i can't just check everything out, then add/edit/delete my local files, then commit).
I've also looked into the Team Foundation Server class, but that's obsolete.
TL;DR: Is there anything I can to do easily sync local changes (add/edit/delete) to VSO, without having to tell it what's been changed?
Why not just check in the changed from your workspace?
If you have a Local Workspace that includes the folder that you generate the SQL into you can just call tf.exe checkin to get all of the changed into TFS.
+Daniel is right.

Folders get recursive after being checked out on my local drive

I keep having a situation where gets annoying (with TFS). I searched for "TFS" and "Recursive folder/files" but didn't find something similar in SOF and then good it but not exactly what I need.
I have checked out a project from TFS (#1) on my local machine and then after some modifications did update them on a new TFS (#2). Later noticed on TFS #2 have:
Solution folder
folder 1/folder 2/files
folder 2
folder 3/folder 3/files
I checked back on TFS #1 things were OK however, for a reason when it gets to my local drive it can get recursive. Anybody knows what I have done wrong? or any settings are involved?
One thing is that folders which go recursive are other developers projects.
Thank you!

Visual SVN - How to maintain separate user settings and publish settings?

For a new MVC web development project, I'm collaborating with a couple of other developers and we want to use Visual SVN to manage source control.
Following the "Getting Started" instructions at the VisualSVN website (http://www.visualsvn.com/visualsvn/getting-started/) seems to to commit everything within the Solution folder including all the settings file (.suo, user, .Publish.Xml)
However, we want to maintain separate Publish Settings within Visual Studio as we publish to our local machines for testing.
Is that possible?
P.S. Shouldn't VisualSVN Client automatically ignore the .suo and .user files?
it doesn't you'll need to either
add them to the ignore on commit lists - you can do this while committing but its a per user setting
remove them from svn - delete them from svn using tortoise as visual svn cant see them (take copies first, as I think this will actually delete them), commit the delete. Put them back into the folder and commit again, svn will show up these files as uncommited, right click on them and select ignore in the commit window, and commit them, this will apply to everyone. Its easier to not commit them in the first place :)
I use SVN as my source control as well. I also use VisualSVN (but only server side). The main thing I would suggest is to use VisualSVN to host your repositories, but use something else to commit/update/checkout your repositories to your local machine.
I would suggest TortoiseSVN for this. Use TortoiseSVN to control your workflow on local machines. You can then use it to simply right-click/ignore your *.suo files. Or any other files/folders you wish to keep out of the repository!
It may take a bit of research to get it setup. But this is what I use on an every day basis, and it is very user friendly.
I've never used VisualSVN, but I would be surprised...no shocked if what you said was true.
Does VisualSVN really by default automatically add and commit user files? You'd think a solution that's built for VisualStudio would simply know better. I would call the company and verify this.
If VisualStudio does commit local user files, I would recommend that you use AnkhSVN instead.
Not only does AnkhSVN know better than to commit user files, it's also open source and you can save yourself the $49 per user you need for VisualSVN. And, it's not just the $50 you're paying per user that you pay with VisualSVN either. It's also the fact that you have another license you need to track while users come in and leave the project. Who do you think is going to get that fun job?
However, if you must use VisualSVN, and VisualSVN does commit user local files by default, You need to get my kitchen sink pre-commit hook. One of the things it does is allow you to completely ban the addition of files such as Visual Studio's *.csuser` files and the other types of VisualStudio detritus.
Of course, you should let developers know how they can set global-ignores and autoproperties in Subversion. This will prevent them from accidentally adding them. But, there's no way you can configure that globally, or to prevent someone from purposefully adding them. Only my pre-commit hook can keep them out of your repository. After a few failed commits because your developers tried to add in these private user files, your developers will quickly fall into line and set up their global-ignores.

Categories