
Update local Git branch list
Ever had the issue where your Git repo has a branch that your local hasn't picked up on? This can often happen when a branch has just been created.
The solution is simple just run...
1$ git remote update origin
Ever had the issue where your Git repo has a branch that your local hasn't picked up on? This can often happen when a branch has just been created.
The solution is simple just run...
1$ git remote update origin
f your using Team Development for Sitecore (TDS) and Github or Git as your source control you may experience an issue where TDS is unable to create/update some of the items in Sitecore, due to a content length issue.
The error will look something like this:
Failed to load version 1 for language en Length of field content does not match the content-length attribute. File name: name, field id: {id}
What's happening comes down to how Github encodes line ending. If your item contains a Rich Text field you can end up with data that has been serialized with both CRLF and LF as the line feed. This will have been included in the content length. However when you push to Git, the CRLF value will have been removed making the content length value incorrect.
To overcome this issue you need to update your .gitattributes file to treat these files differently. Just add this to your file:
# TDS files should be treated as binary *.item -text
If you don't have a .gitattributes file you may run into an issue with windows where it won't let you create it, due to requiring a file-name rather than just an extension.
To create the file:
This is one of those great examples of writing a blog post to yourself to remind you how to do something.
If your using Visual Studio 2012 then to add Git support you will need the Visual Studio Tools for Git plugin created by Microsoft's TFS Power Tools Team (http://visualstudiogallery.msdn.microsoft.com/abafc7d6-dcaa-40f4-8a5e-d6724bdb980c), if your using a later version of Visual Studio then it's already built in.
If you're thinking in of using Git Hub as your source control provider then the most basic thing you're going to need to know is how do you get the Git plugin to link up to GitHub. Here's a couple of different methods;
Click New Repository. Enter a new, Select Public or Private and click Create new Repository.
A new repository will be created in Git Hub
Now the project has been created in Git Hub you will need to clone it to your machine so that you can start adding files and sync then back.
Open a new instance of Visual Studio and do the following:
Rather than creating the Git Hub repo through the GitHub website you can use their app. Once you've got the app installed and logged in do the following:
If you already have a repository cloned on your machine but it's not showing in Team Explorer you can add it by clicking on Add