How Does Git Work

11.10.2019by admin
How Does Git Work Average ratng: 4,4/5 3238 reviews

Using TFS and GIT togetherWhat if your team uses TFS, but you want offline support? You can have a Git repo as well, but then getting your changes to TFS is burdensome. Here’s where a GIT to TFS bridge would be handy. Setting up your repoHere’s how to keep a TFS repository foo, and a GIT repository bar, in sync. First step is you need to create a new TFS workspace: cd tf workspace /new /noprompt FooNow you should place your.git folder from the root of your git repo in the root of your TFS repo. If you don’t have the git repo locally, you can get it like this: cd tempgit clone git@github.com:yourusername/yourgitrepo.gitcd yourgitrepocopy.git Foormdir /S yourgitrepoThen you’ll want to sync the TFS repo up with what was in the GIT repo cd Foogit reset –hardOr if you want to do the other-way around: cd Footf get /overwriteAt this point you should have no pending changes from either TFS or GIT.

  1. How Does Git Work Internally

The git gc command is a repository maintenance command. The 'gc' stands for garbage collection. Executing git gc is literally telling Git to clean up the mess it's made in the current repository. Garbage collection is a concept that originates from interpreted programming languages which do dynamic memory allocation.

How Does Git Work Internally

How does git workHowDoes

Work in git, push to TFSIf you want to do some work in GIT, and then eventually push to TFS, here’s how you’d do it:First, make sure TFS is updated: tf get /overwriteNext, make sure your GIT code is updated: git pullTell TFS about all the git changes tfpt online. /recursive /adds /deletes /diffMake a shelveset with all the pending changes tf shelveRun whatever command executes your tests, and checks in the code Pull from TFS into GITLet’s say someone has checked in something into TFS which you want in GIT.Make sure git is updated: git pullOverwrite your git repo with TFS: tf get /overwriteAs that runs, you’ll see a list of files coming in.

Now you need to tell git about them: git add.Now, commit that to git: git commit -a -m “Sync to head of TFS”Run all your tests, and if they pass, push it out to the remote repo: git push.