git-tfs pushing yout .git folder - git-tfs

I'm new to git-tfs and was wonder if there was a way to ensure that 'some' version of the .git folder would be sent to TFS for storage? (Unless I'm missing something)
If our setup is local dev -> tfs server; then the only copy of the .git would be on the workstation of the developer. Or does this even matter?
A senerio needs to be covered, where we could port all TFS central sources to GIT(hub/lab). Having the .git folder included would allow for this.

Git in TFS does not use TFS source control. Its a separate GIT system. You shouldn't need to check-in your .git folder.
When you want to move your code to Git(hub/lab) you can do that by cloning the source to your local machine and then pushing it up to the remote Git server.

Related

local repository not showing and files and folders

I just cloned my repo from my GitHub account but I'm unable to see any files and folders on my local machine except the .git folder. When I run the git pull command, it says Already up to date and when I run git push command then it again says Everything is up-to-date.
I can assure you that my remote repo is not empty. It has many files and folders.
Below is my remote repo screenshot
I can see you have 2 branches, maybe your default branch if not main in this repo.
Try
git checkout "otherbranch"
or
git switch "otherbranch"

How to recover .git folder deletion?

I accidentally deleted my .git folder, I would like to recover the .git folder, but I permanently deleted it.
Will I lose all my project's history?
I also tryed the following solution with no success.
Notes:
It happened when I imported the code to the Eclipse IDE.
I made many local changes without pushing them.
I also using GitHub as a repo.
Using Windows 10.
If you have pushed your changes to GitHub, then all your history is sitting in the repo on GitHub. You can clone the repo again.
If you have not pushed your changes to a remote repo, then the only place that those changes existed is in your local .git directory in your project directory, and those changes are now gone.
I had to re-clone the repository and paste the .git folder in the recently cloned project, into the project's folder.
So I only lost the local commits.

Visual Studio new Project with wrong git repository

When I create a new project, I connect it with the git source from another existing project, this one is totally new and I don't know why it takes the sources control from the other ones without asking or anything.
For example, I have my project "A" on my computer, connected with git, today I tried to create project "B", and from the beginning, it connects with the git from the project "A", and says that I have tons of changes.
How could I avoid that o change it?
You can delete the .git folder or you can simply change the repository URL as below
Changing a remote repository's URL
The git remote set-url command changes an existing remote repository URL.
git remote set-url origin https://github.com/USERNAME/REPOSITORY.git
Looks like there's a .git folder in your new project directory. Try deleting that and it should work when you connect it again.
I had the same issue and I know how to solve it. For some reason, VSC (Visual Studio Code) has the wrong path for the git folder.
How to fix it:
1.
When you hover your mouse here:
you will see that path (mine pointed to the whole desktop). Delete it in explorer.
2.
In my case, that was all I needed to do. After that VSC found a proper git file.

How to point gitbox/git to different local directory

Hi guys I have a remote repository cloned locally, Because my new changes have saved it to a different directory (workspaces in eclipse) I want to point git to the workspace directory rather than the other directory, how do I do this? Gitbox doesn't seem to have any options, and I can't see the .git folder
In your WORKSPACE do
git init
and then from where you pulled your copy initially. Do
git pull /path/to/your/workspace/project/dir

How to checkout a subfolder from a local svn copy (and not the svn server)?

For some simple Windows batch script, I want to temporarily create a copy of a certain folder in an local working copy of an svn repository at a certain revision. I do not want to checkout directly from the svn server (because then my script needs to know what the server address is, and potentially I would need to authenticate etc.)
And I can not just copy the subfolder, as the hidden .svn folder is higher up.
I have been trying some variations on (with the repo folder containing the .svn hidden folder):
svn co file:///E:/repo/paper#48 E:/temprepo
But that doesn't work. My Windows 7 command prompt answers with
svn: E180001: Unable to connect to a repository at URL 'file:///E:/repo/paper'
svn: E180001: Unable to open an ra_local session to URL
svn: E180001: Unable to open repository 'file:///E:/repo/paper'
I am doing something wrong, or is what I am trying impossible?
Your question seems bit ambiguous. I can think of two ways of looking at this.
Assuming you just want a copy of a sub-folder in a svn working copy WITHOUT the .svn folders.
You can use svn export to copy a given sub-folder of a working copy like this - svn export E:\repo\paper E:\temprepo.
Quote:
And I can not just copy the subfolder, as the hidden .svn folder is
higher up.
EDIT: This file structure is only available in subversion v 1.7. In a subversion client with version 1.6.x sub-folders in a working copy should be self-contained. Meaning you may duplicate it to another place, and do subversion operations like svn update etc. in it.
As you have rightly mentioned in your question, you have working copy of subversion repository and not the repository it self.
You can check out only for a repository that happens to be your subversion server.
When you check out your repository, a pristine version of the repository contents are located inside the ".svn" folders.
This is how svn shows you the diff when your working copy differs from the original contents without routing it's request to server.
It also keeps meta data of your server address and other information which you can see when you do svn info. This also contains your server address as svn url.
Your working copy and the ".svn" folders fully recognize the repository from which it was checked out.
I hope you have understood why you can not checkout from your own working copy.

Resources