I'm so tired of explaining benefits of using DVCS over CVCS to my teammates. Some of them scared of the learning curve, some of them see no reasons because for them: "tis the same fokin ting". Personally I'm so tired of TFS and its problems. Everytime when I need to work on some small "fix" I have to work on the main dev branch and shelve my stuff in and out, cause branching with TFS so darn painful compared to Git. I have to reconnect my VPN client every single time I switch from ethernet to wifi and that happens a lot.
So I started thinking maybe I could use Git locally and do whatever I want on my local repo, and when the time comes push it to TFS. I know it's possible, but what's the best way to do that? Can I just git init
the current repo and put the entire .git
folder into ignored list, so TFS wouldn't check it in or doing just that isn't simply enough?
Until the official update of Visual Studio comes, that will support both git and tfs, I have to use some hacks to do what I want.
Push a new Git branch to a remote repo Clone the remote Git repo locally. Create a new branch with the branch, switch or checkout commands. Perform a git push with the –set-upstream option to set the remote repo for the new branch. Continue to perform Git commits locally on the new branch.
To push a local branch to the remote, right click on that branch in Team Explorer. From the context menu, that pops up on the screen, select Push Branch.
git-tfs https://github.com/git-tfs/git-tfs worked for me better. Easy to install. Easy to use. A bit slow though, but if you don't mind that - works just perfect
Yes, you are exactly correct - you just need to deal with .git in TFS. In general, everything GIT does is maintained in .git so if you have a way to keep it out of TFS (worst case is move out and then move back) then you can use GIT without problems.
Note that there may be other GIT related files to deal with, .gitignore being the most common example.
I've successfully overlaid GIT and SVN using awareness of .git and related files. (I know there is a git-svn package; but that wasn't workable for my specific need.)
Also, look into:
git init --separate-git-dir=<other-location-for-dot-git>
You'll still need to deal with a symbolic link in the local directory but perhaps TFS issues are easier to deal with.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With