I'm gonna make some changes to the default theme of Blogger, but before that, I have to set up a version control system. I'm gonna use Git for that and I will host my Git repository on GitLab.
I have already used Bitbucket before, for a project intended to run on Openshift. Comparing to GitHub, at the time, I think that they provided a free private repository. It's my first time, on GitLab though ...
The main purpose of using a git repository in this case, even though everything will be contained in one single XML file, is to have a log to refer to if something goes wrong. I've already faced that problem on Blogger, making changes and then at some point forgetting about what I did as months passed.
I must also admit that Blogger is not very VCS friendly. Mainly, because all the theme is saved into the same XML file. That file contains CSS, HTML, Javascript and the XML related to widgets. At the moment, the theme have more than 4000 lines of code including compressed javascript. I will certainly add more code in the future and without keeping a track, I'll surely spend up nights trying to figure out what I messed up before.
I have already used Bitbucket before, for a project intended to run on Openshift. Comparing to GitHub, at the time, I think that they provided a free private repository. It's my first time, on GitLab though ...
The main purpose of using a git repository in this case, even though everything will be contained in one single XML file, is to have a log to refer to if something goes wrong. I've already faced that problem on Blogger, making changes and then at some point forgetting about what I did as months passed.
I must also admit that Blogger is not very VCS friendly. Mainly, because all the theme is saved into the same XML file. That file contains CSS, HTML, Javascript and the XML related to widgets. At the moment, the theme have more than 4000 lines of code including compressed javascript. I will certainly add more code in the future and without keeping a track, I'll surely spend up nights trying to figure out what I messed up before.
I don't want it to be all simple so I'm gonna create a repository locally then I will push it to a GitLab's empty repository that I will create. I will also use SSH for authentication.
How I configure Git:
I initiate a new repo, then I change my username locally so that it will fit my GItLab username :
git init
git config --local user.name "GitLabUsername"
I place the XML file of the theme in the repo folder, check the status. As expected, it tells me that the newly added file has not yet been tracked :
git status
On branch master
No commits yet
Untracked files:
(use "git add <file>..." to include in what will be committed)
theme-5943132723852692044.xml
nothing added to commit but untracked files present (use "git add" to track)
I add file contents to the index :
git add theme-5943132723852692044.xml
I check the status again
git status
On branch master
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: theme-5943132723852692044.xml
Time to put a good commit message and and using Vim :
git commit
But that could have been done with -m flag :
git commit -m "Release the first commit"
I check the status again
git status
On branch master
nothing to commit, working tree clean
No comments: