-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
200 lines (128 loc) · 11.2 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Fakhruddin's blog</title>
<meta name="author" content="Fakhruddin Ali Hussain">
<meta name="description" content="A blog about JavaScript, WebDev and everything else">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta property="og:site_name" content="Fakhruddin's blog"/>
<meta property="og:image" content="undefined"/>
<link href="/favicon.png" rel="icon">
<link rel="alternate" href="/atom.xml" title="Fakhruddin's blog" type="application/atom+xml">
<link rel="stylesheet" href="/css/style.css" media="screen" type="text/css">
<!--[if lt IE 9]><script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-6884036-1', 'auto');
ga('send', 'pageview');
</script>
</head>
<body>
<header id="header" class="inner"><div class="alignleft">
<h1><a href="/">Fakhruddin's blog</a></h1>
<h2><a href="/"></a></h2>
</div>
<nav id="main-nav" class="alignright">
<ul>
<li><a href="/">Home</a></li>
<li><a href="/archives">Archives</a></li>
</ul>
<div class="clearfix"></div>
</nav>
<div class="clearfix"></div>
</header>
<div id="content" class="inner">
<div id="main-col" class="alignleft"><div id="wrapper">
<article class="post">
<div class="post-content">
<header>
<div class="icon"></div>
<time datetime="2017-04-16T05:31:00.000Z"><a href="/Git-Guide/">Apr 15, 2017</a></time>
<h1 class="title"><a href="/Git-Guide/">Git Guide</a></h1>
</header>
<div class="entry">
<h1 id="Problem-description"><a href="#Problem-description" class="headerlink" title="Problem description"></a>Problem description</h1><p>For the company that I work we tried quite a few code versioning tools before finalizing Git. We tried our hands on CVS, SVN and Perforce with less than satisfactory results. Even now we have multiple models for handling Git versioning. Some of us use Gerrit and others are happy with the usual Github Fork and Pull Request model.</p>
<h1 id="Suggested-Git-model"><a href="#Suggested-Git-model" class="headerlink" title="Suggested Git model"></a>Suggested Git model</h1><p>We use Github enterprise version which is an in-house hosted service similar to public Github. For our products we have a platform repository and each teammate has a fork of the repository and work on their fork.</p>
<p>Our main working branch is develop and released code is merged in master. For more information you can read <a href="http://nvie.com/posts/a-successful-git-branching-model/" target="_blank" rel="external">git branching model by Vincent Driessen</a>.</p>
<h1 id="Some-commands"><a href="#Some-commands" class="headerlink" title="Some commands"></a>Some commands</h1><p><strong>Clone</strong> - <code>git clone [email protected]:myname/product.git</code>. Here I am assuming you have already forked the platform repository and is available in your Github space.</p>
<p><strong>Add remote</strong> - <code>git remote add upstream [email protected]:myname/product.git</code>. It’s a common convention to call your fork ‘origin’ and the platform repo as ‘upstream’. You can call it something else if you so desire but conventions make everyone’s life a tad bit easier so I would recommend sticking with them.</p>
<p><strong>Create feature branch</strong> - <code>git checkout -b ft-my-changes</code> It’s a good idea to create a feature branch for each change you work on. This makes the pull request process manageable.</p>
<p><strong>Pull latest changes</strong> - <code>git pull --rebase upstream develop</code>. While the pull would still works without the “rebase” switch it results in a lot of unnecsssary merge commits if you pull changes frequently.</p>
<p><strong>Check changed files</strong> - <code>git status</code>. Once you start modifying your code you may want to know what are the changes made. This command is a handy way to find out what files are changes, what are added and which of these are staged for committing.</p>
<p><strong>Check changes in files</strong> - <code>git diff myfile.js</code>. This command would show you the changes in a file. If you don’t provide a filename then it shows the diff for all changed files. If you have staged your changes (see below) you can still find out the changes by using <code>git diff --cached</code>.</p>
<p><strong>Stash changes</strong> - <code>git stash save MEANINGFUL_MESSAGE</code>. While pulling changes you would face the issue of what to do with the local changes. Git provides functionality to stash the changes in a temporary store which can be reapplied later.</p>
<p><strong>Apply stashed changes</strong> - <code>git stash apply</code> OR <code>git stash pop</code>. You can use any of these commands to apply the stashed changes back. If you use <code>git stash apply</code>, remember to clean up the stash storage by using <code>git stash drop</code>.</p>
<p><strong>Stage changes</strong> - <code>git add <list of files></code>. Just using <code>git add .</code> would add all changed/added files to stage for commit but I won’t recommend it as with time you would end up having some files that you may not want to check-in. For example, I modify some development files to optimize my development flow.</p>
<p><strong>Commit changes</strong> - <code>git commit</code>. While you can add a single line commit using a <code>-m "message"</code> switch you shouldn’t do it. My recommendation is to put a change identifier (JIRA ticket etc) and a short message describing the change, leave a line empty and add multiple lines of change description.<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">PROD-123: Added a nice new feature</div><div class="line"></div><div class="line">ADD: Description of new feature</div><div class="line">FIX: Fixed some bugs</div></pre></td></tr></table></figure></p>
<p><strong>Modify last commit</strong> - <code>git commit --amend</code>. You would frequently require to modify the changes you had just committed. Use this command to do that.</p>
<p><strong>Push changes to remote</strong> - <code>git push origin ft-my-changes</code>. You should push the changes to your repository once you are done. You can do that halfway in your development cycle too. Just remember to amend your existing commit and do a force push - <code>git push origin +ft-my-changes</code>. Once you have done this you can go to the upstream repo and create a Pull Request for review and merge.</p>
<h1 id="Final-words"><a href="#Final-words" class="headerlink" title="Final words"></a>Final words</h1><p>While there are many more git commands that you must know to be a called an expert at this versioning tool but I believe these are enough to survive on a day to day basis. If you want to learn more I recommend reading <a href="https://git-scm.com/book/en/v2" target="_blank" rel="external">Git SCM book</a>.</p>
</div>
<footer>
<div class="clearfix"></div>
</footer>
</div>
</article>
<article class="post">
<div class="post-content">
<header>
<div class="icon"></div>
<time datetime="2017-01-02T07:11:00.000Z"><a href="/A-New-Awakening/">Jan 01, 2017</a></time>
<h1 class="title"><a href="/A-New-Awakening/">A New Awakening</a></h1>
</header>
<div class="entry">
<h1 id="Purpose"><a href="#Purpose" class="headerlink" title="Purpose"></a>Purpose</h1><p>With the start of 2017 I am reviving my old blog which I started back in 2008 but abandoned for lack of time.</p>
<p>This blog would contain posts about JavaScript, web development, and some posts about life in general. Notice dates are not part of the permalink (url) as I plan to re-visit old articles and update them with new developments.</p>
<h1 id="Initial-stack"><a href="#Initial-stack" class="headerlink" title="Initial stack"></a>Initial stack</h1><p>While my old blog was based on <a href="https://wordpress.org" target="_blank" rel="external">Wordpress</a>, this one is a static site generated with <a href="https://hexo.io" title="A fast, simple & powerful blog framework" target="_blank" rel="external">Hexo</a> and hosted on <a href="https://pages.github.com/" title="Github website hosting platform" target="_blank" rel="external">Github Pages</a>. The reason for not using Wordpress is it is an overkill for simple websites such as this one. Also, it’s hard to say no to Github’s free and fast static hosting.</p>
<p>With additional weightage given to an HTTPS site by Google, I think it is good time to jump on the bandwagon. Thanks to <a href="https://www.cloudflare.com" title="CDN and free SSL" target="_blank" rel="external">Cloudflare</a> which provides SSL for free. The setup process was fairly simple.</p>
<p>I am using <a href="https://github.com/hexojs/hexo-theme-light" title="Official theme - Light" target="_blank" rel="external">Light</a> theme for now but I wish to create a theme that is both Responsive and Accessibility-compliant. Ideas are welcome.</p>
<p>For handling user comments I am currently exploring <a href="https://disqus.com" title="Disqus comment system" target="_blank" rel="external">Disqus</a>. Let’s see how the trial goes.</p>
</div>
<footer>
<div class="clearfix"></div>
</footer>
</div>
</article>
<nav id="pagination">
<div class="clearfix"></div>
</nav></div></div>
<aside id="sidebar" class="alignright">
<div class="search">
<form action="//google.com/search" method="get" accept-charset="utf-8">
<input type="search" name="q" results="0" placeholder="Search">
<input type="hidden" name="q" value="site:www.fakhru.com">
</form>
</div>
</aside>
<div class="clearfix"></div>
</div>
<footer id="footer" class="inner"><div class="alignleft">
© 2017 Fakhruddin Ali Hussain
</div>
<div class="clearfix"></div></footer>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script src="/js/jquery.imagesloaded.min.js"></script>
<script src="/js/gallery.js"></script>
<script type="text/javascript">
var disqus_shortname = 'fakhruddin';
(function(){
var dsq = document.createElement('script');
dsq.type = 'text/javascript';
dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
}());
</script>
<link rel="stylesheet" href="/fancybox/jquery.fancybox.css" media="screen" type="text/css">
<script src="/fancybox/jquery.fancybox.pack.js"></script>
<script type="text/javascript">
(function($){
$('.fancybox').fancybox();
})(jQuery);
</script>
</body>
</html>