Having trouble accessing Documents using the cd command on Git Bash - command

I'm trying to access the Documents folder, I succeeded in doing so but there's some weird error which isn't letting me see my files and changing the contents of the folder OR it's accessing a different folder.
Documents folder:
Command:

Turns out, since I had my Documents linked with OneDrive, it changed it's location path.

Related

How to mirror/synchronize a local workspace folder with the server folder?

I have a folder that regularly gets updated. This folder is a part of a TFS workspace. I need to commit all those changes to the workspace once they occur (add what isn't there, delete what was removed and update what was changed).
Currently, I have a script that runs tf vc folderdiff command on the folder and its server counterpart, parses out the output to get three lists - files that need to be added, deleted and updated. It then manually adds, deletes and updates those files by invoking tf add/delete/checkout on batches of files (trying to add/delete/checkout in one go can cause an error if there are too many files in the list).
There has to be some better way. Is there some kind of tf command where I can tell it, look at this local folder, look at the server folder that is mapped to it and make the server folder look exactly the same? Bonus points if I can specify some kind of filter to exclude certain paths or file names/extensions.
Apparently there exists a tf reconcile command. You can learn more about the syntax here: https://learn.microsoft.com/en-us/azure/devops/repos/tfvc/reconcile-command
Off the top of my head, the following command should do what I want:
tf reconcile [path to folder] /promote /adds /deletes /recursive /noprompt
There is also /exclude that can be used to filter unwanted files, so I get the bonus points too.
Of course I had to stumble upon it right after asking a question...

Excluding files/folders from VSTS publish

We are using the new VSO/VSTS style build within TFS on premise, 2015 Update 1 as of yesterday.
During the publish build artifacts stage we want to copy all the files/folders from a root bar 2 sub folders.
ie:
$\somefilestopublish1\...
$\somefilestopublish2\...
$\somefilestoexclude1\...
$\somefilestoexclude2\...
Currently I have **\* as the contents argument which obviously will publish everything. I have tried appending ;-:<exclude_pattern> as suggested by a Google search but that just stopped all output and resulted in an empty folder.
Is there a way to use the minimatch expression to exclude folders or will I need to swap to explicitly selecting the folders to publish instead.
Minimatch use "!" to exclude the given pattern. You could specify it with following format:
!(somefilestoexclude1|somefilestoexclude2)
Following is the example:
With !(bin|obj), "bin" folder and "obj" folder under "WindowsFormsApplication1" folder are not copied to artifact.
!/$tf/** works for me. I've opted to shorten that to !/$*/**
http://www.globtester.com/ helped. The $ symbol doesn't have to be escaped despite conflicting guidance on msdn: https://msdn.microsoft.com/en-us/library/bb383819.aspx.
Suppose you want to collect all the *.nupkg files in your solution (for instance the ones you create during build) and copy them to another folder, but you want to exclude the ones you get through the package restore, you need to specify the following:
**\*.nupkg
!packages\**
It's important to specify them in this order. Placing the exclusion on the packages folder on top, will result in the Copy task copying all the *.nupkg files.
This worked for me for folder try this !**\Uploads***
For file **!(Web.config)
Above example is for excluding a folder and file available in same folder path.
On TFS 2017 Update 1 if you are using the Copy Files task and you want to copy all files from the $(Build.SourcesDirectory) but exclude the $tf folder what I found to work was the following.
In the Contents text box enter the following two lines.
**\*
!$tf\**
This post on social.msdn.microsoft.com is what helped me figure this out.

How to cloak directories in TFS command line

I want to ignore some directory while checking out code from TFS using TFS command line.
For example, say i have a TFS url path where i have two directory, namely Iteration9 and Iteration11 .
Now I want to check out from that url path such a way so that only Iteration9 gets checked out and ignore the Iteration11
So far i am following the steps,
Create a workspace named cloak_1:
./tf workspace -new -collection:http://tfsna.int.com:8080/tfs/C_Collection -login:user27#domain,password cloak_1;
Cloak the Iteration11 directory which i don't want:
./tf workfold -cloak $/Cobalt Search/Releases/1.0/Iteration11 -workspace:cloak_1 -login:user27#domain,'password';
Map the path to my local Directory:
./tf workfold -map -workspace:cloak_1 -login:user27#domain,password '$/C_Search/Releases/1.0' /tfs/TEE-CLC-10.1.0/cl-test1;
Finally get the source code:
./tf get -recursive -login:user27#domain,password /tfs/TEE-CLC-10.1.0/cl-test1;
But the cloak is not working here. i am getting both the directory in my local folder. please tell me where i am doing wrong.
You can create the workspace configuration that your want in visual studio with the UI and then clone it when you want to use it.
http://roadtoalm.com/2011/10/25/hidden-gems-in-tfspart-6-managing-workspaces-in-tfs-with-workspace-templates/

How can I add a directory tree to my github repo?

I've been working on a project that's fairly far a long now and I decided it's time to use some sort of version control etc. I decided to go with github. Before I get in too deep let me state explicitly that I am new to github.
My project resides in a directory that contains myriad subdirectories and files of all different kinds. I'd like to take my project directory as is (structure and all) and put it in my github repo.
I followed the tutorials on github's webpage, created the repo, and manually added some files. Obviously I don't want to manually add every file (there are several hundred). I'd like to know how I can add the root directory or for that matter any parent directory and all files/folders in said said directory. In other words I'm looking for a recursive add.
I read on this SO page (How to create folder in github repository?) that you can just use
git add directory/
That works fine for me when I'm dealing with the lowest level directory, but when I try the same command on a directory with subdirectories my terminal just sits there and I have to ctrl-c. I can't tell if it's just taking a long time (as I mentioned there are lots of files) or if this is just the wrong way to add a directory with subdirectories.
Apologies in advance if this is a super ignorant question -- I have looked at a lot of blogs/posts/etc and I cannot find a solution that seems to work.
Use the Current Working Directory
Assuming you're on Linux or OS X, from the command line you would do the following:
git add .
from the root of your repository tree. That will add all non-ignored files, including non-empty directories, into the repository.
From the root directory (the one with all the subdirectories), use git add -A.
If you have a ton of subdirectories and files, it may take a long while, so just let it sit there until it's done.

Why does .meteor have a .gitignore file?

I am creating a new meteor app and would like to put the whole thing under git source control. When cloning a working copy of my meteor directory, meteor gives : run: You're not in a Meteor project directory.
After inspecting the .meteor directory, I see that the files in here are being excluded in my local clone.
Is there a particular reason this is done?
as #Swadq already pointed about, the .meteor directory is Meteor's directory. It contains a folder and a file.
The local directory contains the compiled version of your application and some database information (lock-file and the actual raw data of mongodb). This of course should not be included in your VCS.
The package file contains all packages meteor should load for your application. This is of course important and must be included in your VCS. More importantly: this file is checked for to determine if the current directory is a meteor application. If you don't include this you'll loose the packages you relay on and the ability to simply run the app. using meteor.
So ideally your .gitignore file only should contain .meteor\local but not .meteor\packages. When using meteorite the .gitignore file should contain .meteor\meteorite as well.