I am using visual studio code to develop my flutter app.
I need to share it with a colleague. I was able to make the transfer on gitlab very easily.
I have a problem.
When my colleague makes changes to my code, before "taking" his changes I would like to be able to view them on visual studio code.
I have tried several avenues, but each time my code is synchronized and modified according to the changes made
Can anyone help me?
1:Click Git icon on left side of VS Code
2:If you've made changes to the file(s) since last commit, you'll see the file(s) listed under "CHANGES"
3:Right click the file name (under "CHANGES") and click "Open Changes"
4:This will open the two versions of the file side by side with the changes highlighted
I believe this is how you see the changes that your college made on GitLab
Related
Out of sudden I noticed the git options not working in my visual code editor. All I see are the plain text, they used to be segment in different background color and also links where I can click to accept incoming/remain current changes etc..
Current problem is showing this
Should be like this
In VS code there is another way to merge code conflicts which you can find
Settings -> Git Merge (under user tab).
just uncheck that and then it will show you Merge options on your page like you are looking for.
Hope this helps.
GitHub Desktop doesn't detect any code changes in real-time. It only displays "No local changes".
It only displays changes once I've saved the file in Visual Studio Code.
before saving
after saving
GitHub Desktop after saving the file in VSCode
How do I make it detect changes in real time?
I did what ElpieKay said, I enabled autosave on focus change in the settings of VS Code. Now GitHub will detect changes in real-time.
When using source control every change showes up as they should, but when I try to commit, push, pull etc nothing happens. This happens with both old and new projects. I have tried to reinstall the app without any luck. How can I fix this? Is there a way to "reset" source control?
I've reinstalled my PC and tried connecting back up to my Azure DevOps Repo using VS Code and TFVC. I'm using TFVC Location with Visual Studio 2019 Community TF.exe. It all seems to work and I can connect to my repo with my credentials. It all seems to load up fine and I can even see TFVC with a number of changes/differences. - see image below. However I'm expecting to see my source control and list of files to commit like before. But the panel is blank. There's no errors in the Output window of VS Code either.
I've tried removing and re-adding the workspace. Tried editing/adding anew file to the project in hope of kickstarting TFVC pane to show the file list. - the number next to TFVC updates but I don't see any menu button or files list.
Has anyone else had this and know a solution, or know where I'm going wrong.
Just toggle "scm.alwaysShowProviders" on and off from whatever value your have (default is false), this would cause the source control pane to redraw and fix the issue for now.
I believe per the issues in GitHub that this issue is fixed for most people as of VSCode version 1.39.2, but I was still seeing it for projects based on a Git repo.
After some trial and error I found this setting was the culprit: "scm.alwaysShowProviders": true
When I remove that setting, or set it to false, my Source Control pane works correctly.
This happens to me occasionally. I just figured out I can fix this by right clicking in the blank area and then selecting the repository I want to show up
Issue opened on GitHub: https://github.com/microsoft/vscode/issues/82374
For now I've rolled back to the August update and that's resolved it.
Clicking the blank area and slecting repo does the trick
I had this problem on the 1.55 version, as it's centrally controlled I couldn't manually update, but when they pushed the 1.64 version through, the problem has gone away, was driving me mad!
I want to link to a line of code in such a way that the link will continue to work even when the file is updated in future commits.
In Github I would do this by pressing 'y' to move to a version of the page that includes the blob SHA:
https://github.com/rails/rails/blob/b49e38b76b0998b0a8312d8c08c98728d3de2006/activerecord/lib/arel/attributes/attribute.rb#L30
(Alternatively GitHub has a 'copy permalink' option in the '...' menu that appears in the margin when you select a line - documented here.)
Is there an equivalent in Azure DevOps?
The link that I get when I select a line has the form:
https://.../_git/project?path=XXXX&version=GBmaster&line=426&lineStyle=plain&lineEnd=427&lineStartColumn=1&lineEndColumn=1
Lots of parameters defining the selection but nothing pinning the file version.
Edit:
The below illustrations can be summarized in a few keyboard shortcuts.
Open the repo Files view using the 'e' global shortcut
Use 't' to put focus on the path selection to quickly navigate to the file in question
point 2 and 3 are order agnostic in relation to one another
Use 'y' to change the Files view to be based on the latest commit instead of on the branch
Make selection
Copy link as shown in illustration below
Browse files on the commit
Make sure you're browsing the entire source for the commit. Selecting lines when viewing the commit itself (ie AzDOs fancy git show) is for adding comments to the commit, but it doesn't help produce a link to the line # that version, nor is there a way (at least not that I could find) to get a link to the comment made on the line. Getting a link to a comment on a line in a commit might have been helpful to provide additional direct context to what is linked and why, but that's also not what you asked for.
don't click on the commit itself
make sure you're browsing all files as of a commit (not a branch)
Make selection
You should be able to select a line in the file contents and get a link to that line(s) in that version.
note: the link produced here is even more lengthy than the one you provided in your question.
Joy
When you navigate to the copied link, you will be directed to the commit and file contents with the line highlighted.
Understand, this link is bound to the commit you used to create it not to the tip of the branch. I expect this was how links are surfaced to be more sure that the link wouldn't break or lose context as the commit at the tip of the branch changes over time.
Thank you #JoshGust. For anyone else who wants the abbreviated version:
Files -->
(your repo branch) -->
History -->
Click A Commit hash/number (Latest/Head usually) -->
Browse Files -->
Your file -->
Select text & get a link.
Sheesh... quite some hoops to jump through, but glad it's possible.
To create a web (repository) link to a specific line from within your IDE, there are extensions with options to link to files, selections, to a branch or to a specific commit.
I am using these ones:
Editor
Plugin
Visual Studio Code
Git Web Links for VS Code
Visual Studio 2022
Git Web Links