<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Git Archives - SideCode</title>
	<atom:link href="https://sidecode.io/dev-blog-category/git/feed/" rel="self" type="application/rss+xml" />
	<link>https://sidecode.io/dev-blog-category/git/</link>
	<description>Web Development &#38; IT Consulting Company</description>
	<lastBuildDate>Thu, 14 May 2020 09:17:13 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.1</generator>

<image>
	<url>https://sidecode.io/wp-content/uploads/logo_icon-150x150.png</url>
	<title>Git Archives - SideCode</title>
	<link>https://sidecode.io/dev-blog-category/git/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Making .gitignore to take effect (gitignore is not working)</title>
		<link>https://sidecode.io/dev-blog/making-gitignore-to-take-effect-gitignore-is-not-working/</link>
		
		<dc:creator><![CDATA[jhonny]]></dc:creator>
		<pubDate>Sun, 29 Mar 2020 10:19:37 +0000</pubDate>
				<guid isPermaLink="false">https://sidecode.io/?post_type=blog&#038;p=1168</guid>

					<description><![CDATA[<p>When you add/modify the .gitignore file and then try to commit the changes, you will see that the files you asked git to ignore are still on the HEAD, they are still there, this is because you need to tell git to remove them from the index. The way to &#8220;fix&#8221; .gitignore file is ...</p>
<p>The post <a rel="nofollow" href="https://sidecode.io/dev-blog/making-gitignore-to-take-effect-gitignore-is-not-working/">Making .gitignore to take effect (gitignore is not working)</a> appeared first on <a rel="nofollow" href="https://sidecode.io">SideCode</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>When you add/modify the .gitignore file and then try to commit the changes, you will see that the files you asked git to ignore are still on the HEAD, they are still there, this is because you need to tell git to remove them from the index.</p>
<p>The way to &#8220;fix&#8221; .gitignore file is after making in a .gitignore file, not matter if you working with BitBucket, GitHub, or any other service, to fix the issue you need to execute these commands:</p>
<pre>git rm -rf --cached .
git add . 
git commit -m 'fixed gitignore'</pre>
<p><code>git rm -r --caced</code> &#8211; will remove the files completely from the index (just like add is adding to the index).</p>
<p><code>git add .</code> &#8211; will add all of the files (this is the dot, dot means all).</p>
<p><code>git commit -m 'fixed gitignore'</code> &#8211; will commit the the changes with the label of: &#8220;fixed gitignore&#8221;, this can be whatever you want, for me, each time I start a project and do the first commit, I ALWAYS forget to add/change/create the .gitignore file, so my two first commits are always: &#8216;inital commit&#8217; and &#8216;fixed .gitignore&#8217;.</p>
<p>The post <a rel="nofollow" href="https://sidecode.io/dev-blog/making-gitignore-to-take-effect-gitignore-is-not-working/">Making .gitignore to take effect (gitignore is not working)</a> appeared first on <a rel="nofollow" href="https://sidecode.io">SideCode</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Bitbucket &#8211; Setup Git on a Remote Server For an existing Repo</title>
		<link>https://sidecode.io/dev-blog/bitbucket-setup-git-on-a-remote-server-for-an-existing-repo/</link>
		
		<dc:creator><![CDATA[jhonny]]></dc:creator>
		<pubDate>Wed, 12 Apr 2017 09:59:03 +0000</pubDate>
				<guid isPermaLink="false">https://sidecode.io/?post_type=blog&#038;p=1146</guid>

					<description><![CDATA[<p>Step 1: Switch to your repository&#8217;s directory cd /path/to/your/repo Step 2: Connect your existing repository to Bitbucket git remote add origin https://PATH_TO_YOUR_REPO git push -u origin master</p>
<p>The post <a rel="nofollow" href="https://sidecode.io/dev-blog/bitbucket-setup-git-on-a-remote-server-for-an-existing-repo/">Bitbucket &#8211; Setup Git on a Remote Server For an existing Repo</a> appeared first on <a rel="nofollow" href="https://sidecode.io">SideCode</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Step 1: Switch to your repository&#8217;s directory</p>
<pre>cd /path/to/your/repo
</pre>
<p>Step 2: Connect your existing repository to Bitbucket</p>
<pre>git remote add origin https://PATH_TO_YOUR_REPO</pre>
<pre>git push -u origin master</pre>
<p>The post <a rel="nofollow" href="https://sidecode.io/dev-blog/bitbucket-setup-git-on-a-remote-server-for-an-existing-repo/">Bitbucket &#8211; Setup Git on a Remote Server For an existing Repo</a> appeared first on <a rel="nofollow" href="https://sidecode.io">SideCode</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Setting Git on a Production Server</title>
		<link>https://sidecode.io/dev-blog/setting-git-on-a-production-server/</link>
		
		<dc:creator><![CDATA[jhonny]]></dc:creator>
		<pubDate>Sat, 25 Mar 2017 09:57:42 +0000</pubDate>
				<guid isPermaLink="false">https://sidecode.io/?post_type=blog&#038;p=1145</guid>

					<description><![CDATA[<p>To set your git repo on your production server. go tho the root directory of the server (i.e. public_html or httpdocs etc.) then run: git init run (to connect your server with the cloud repo) git remote add origin https://PATH_TO_YOUR_REPO Then if you want your production server to always pull from the remote origin ...</p>
<p>The post <a rel="nofollow" href="https://sidecode.io/dev-blog/setting-git-on-a-production-server/">Setting Git on a Production Server</a> appeared first on <a rel="nofollow" href="https://sidecode.io">SideCode</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>To set your git repo on your production server.<br />
go tho the root directory of the server (i.e. public_html or httpdocs etc.)<br />
then run:</p>
<pre>git init</pre>
<p>run (to connect your server with the cloud repo)</p>
<pre>git remote add origin https://PATH_TO_YOUR_REPO
</pre>
<p>Then if you want your production server to always pull from the remote origin (so you will be able to run git pull instead of git pull origin master)<br />
You need to add this to your /.git/cofig, you can do this like this:</p>
<pre> git config branch.master.remote origin
 git config branch.master.merge refs/heads/master
</pre>
<p>Now you can run git pull, and it will automatically pull from your master branch.</p>
<p>&nbsp;</p>
<p>If you also git to remember your password (so you won&#8217;t need to type it with every &#8220;git pull&#8221;)</p>
<p>enable credentials cache: (make sure you have git version &gt; 1.7.12.1, which you probably have).</p>
<pre class="prettyprint prettyprinted"><span class="pln">git config </span><span class="pun">--</span><span class="kwd">global</span><span class="pln"> credential</span><span class="pun">.</span><span class="pln">helper cache</span></pre>
<p>The post <a rel="nofollow" href="https://sidecode.io/dev-blog/setting-git-on-a-production-server/">Setting Git on a Production Server</a> appeared first on <a rel="nofollow" href="https://sidecode.io">SideCode</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Git Error &#8211; invalid active developer path (also called, did you upgraded to macOS Sierra?)</title>
		<link>https://sidecode.io/dev-blog/git-error-invalid-active-developer-path-also-called-did-you-upgraded-to-macos-sierra/</link>
		
		<dc:creator><![CDATA[jhonny]]></dc:creator>
		<pubDate>Wed, 01 Feb 2017 09:59:58 +0000</pubDate>
				<guid isPermaLink="false">https://sidecode.io/?post_type=blog&#038;p=1148</guid>

					<description><![CDATA[<p>If you are getting this error,  error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun This is because you are on a Mac, and you upgraded to macOS Sierra. To fix this, all you need to do is update/install Xcode. run this command in the terminal: &#160; xcode-select --install Run the command, agree ...</p>
<p>The post <a rel="nofollow" href="https://sidecode.io/dev-blog/git-error-invalid-active-developer-path-also-called-did-you-upgraded-to-macos-sierra/">Git Error &#8211; invalid active developer path (also called, did you upgraded to macOS Sierra?)</a> appeared first on <a rel="nofollow" href="https://sidecode.io">SideCode</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>If you are getting this error,  error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun</p>
<p>This is because you are on a Mac, and you upgraded to macOS Sierra.</p>
<p>To fix this, all you need to do is update/install Xcode.<br />
run this command in the terminal:</p>
<p>&nbsp;</p>
<pre>xcode-select --install</pre>
<p>Run the command, agree to the agreement and install Xcode.<br />
This will fix the issue.</p>
<p>The post <a rel="nofollow" href="https://sidecode.io/dev-blog/git-error-invalid-active-developer-path-also-called-did-you-upgraded-to-macos-sierra/">Git Error &#8211; invalid active developer path (also called, did you upgraded to macOS Sierra?)</a> appeared first on <a rel="nofollow" href="https://sidecode.io">SideCode</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Git &#8211; General Notes and Basic commands</title>
		<link>https://sidecode.io/dev-blog/git-general-notes-and-basic-commands/</link>
		
		<dc:creator><![CDATA[jhonny]]></dc:creator>
		<pubDate>Mon, 07 Nov 2016 10:18:03 +0000</pubDate>
				<guid isPermaLink="false">https://sidecode.io/?post_type=blog&#038;p=1163</guid>

					<description><![CDATA[<p># Starting git on a folder git init # Starting BitBucket repo # It&#8217;s Pretty much the same process for any other git service like GitHub. BTW, the main difference between GitHub and BitBucket services is that in Github it&#8217;s free to create public reops, and in BitBucket it&#8217;s free to create private repos. ...</p>
<p>The post <a rel="nofollow" href="https://sidecode.io/dev-blog/git-general-notes-and-basic-commands/">Git &#8211; General Notes and Basic commands</a> appeared first on <a rel="nofollow" href="https://sidecode.io">SideCode</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3><a href="#"># </a>Starting git on a folder</h3>
<pre>git init
</pre>
<h3><a href="#"># </a>Starting BitBucket repo</h3>
<h6># It&#8217;s Pretty much the same process for any other git service like GitHub.</h6>
<p>BTW, the main difference between GitHub and BitBucket services is that in Github it&#8217;s free to create public reops, and in BitBucket it&#8217;s free to create private repos.<br />
(Public repos, the whole world can see. Private repos, are only yours to see, or anyone else you choose to share it with).</p>
<p>Create a repo in the web interface (BitBucket Website).<br />
Create a folder on local machine (the root folder that will contain your project).<br />
let&#8217;s say ~/username/sites/myWebsite<br />
In the command line do:</p>
<pre>cd ~/username/sites/myWebsite 
git init 
git add . 
git commit -m ‘Inital Commit’
git remote add origin &lt;repo-url&gt; 
git push origin master 
</pre>
<h6>Explanation:</h6>
<p><code>git init</code> &#8211; start a git repo inside your folder.<br />
<code>git add .</code> &#8211; Add all of the current folder files to your next commit.<br />
<code>git commit -m ‘Inital Commit’</code> &#8211; &#8220;save&#8221; or commit, create a commit with the name &#8220;Inital Commit&#8221; (you can give it any name you want).<br />
<code>git remote add origin &lt;repo-url&gt;</code> &#8211; here copy and paste the repo url from BitBucket<br />
<code>git push origin master </code> &#8211; push your changes, (your new commit) to the BitBucket Repo.</p>
<h3><a href="#"># </a>Removing all latest changes (deleting them)</h3>
<p>If you made some changes, you don’t want them (at all), and just want to checkout a different commit, (go back in time, if you will).<br />
you will get an error as long as there are unstated files, to remove them do:</p>
<pre>git clean -f -d # remove untracked files
</pre>
<h3><a href="#"># </a>.Gitignore</h3>
<p>IF you want to commit all files except certain files (like config files with Passwords, or just trash files like .codekit) that you only need on your local machine. You need to tell git to ignore these files, the way to do it is to create a <code>.gitignore</code> file.</p>
<p>Create a .gitignore file</p>
<pre>nano .gitignore (or just don't be weird and create a file in a different way).
</pre>
<p>add whatever you want git to ignore like:</p>
<pre>.DS_Store // this will ignore the .DS_Store files that is created by MAC OS.
</pre>
<p>IF you want to ignore a complete dir with all of the files in the dir and subdirectories</p>
<pre>.idea/
</pre>
<p>If you want to ignore all files with some extension do (ex: ignore all .log files):</p>
<pre>*.log
</pre>
<p>If you want to add comments to the .gitignore, (notes for yourself, because you keep forgeting what you are doing) do:</p>
<pre># this is a comment
</pre>
<p>then to make the .gitignore take effect do:</p>
<pre>git rm -r --cached .
git add .
git commit -m "fixed untracked files"
</pre>
<h3><a href="#"># </a>General Commands</h3>
<p><code>git status</code> &#8211; get the status of a git repo</p>
<p><code>git log</code> &#8211; see commits of the repo</p>
<p><code>git init</code> &#8211; start a git repo</p>
<p><code>git add .</code> &#8211; stage all changed files to the next commit</p>
<p><code>git commit -m ‘title of commit’</code> &#8211; committing a repo with a title.</p>
<p><code>git checkout &lt;name of branch or master&gt;</code> &#8211; checkout different commit/branch</p>
<p><code>git pull</code> &#8211; pull changes of repo from origin reposetory</p>
<p><code>git push</code> &#8211; push changes of repo to origin reposetory</p>
<p><code>git checkout -f</code> &#8211; will checkout master with force (ignore all changes, you will lose all untracked files).</p>
<p><code>git clean -fd</code> &#8211; remove untracked files, -f &#8211; force it, -d &#8211; remove also directories that are untracked.</p>
<p>The post <a rel="nofollow" href="https://sidecode.io/dev-blog/git-general-notes-and-basic-commands/">Git &#8211; General Notes and Basic commands</a> appeared first on <a rel="nofollow" href="https://sidecode.io">SideCode</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Git &#8211; Remove Unsaved Changes</title>
		<link>https://sidecode.io/dev-blog/git-remove-unsaved-changes/</link>
		
		<dc:creator><![CDATA[jhonny]]></dc:creator>
		<pubDate>Sun, 14 Aug 2016 09:59:30 +0000</pubDate>
				<guid isPermaLink="false">https://sidecode.io/?post_type=blog&#038;p=1147</guid>

					<description><![CDATA[<p>To remove all changes you made  and &#8220;reset&#8221; to the last commit # Revert changes to modified files. git reset --hard # Remove all untracked files and directories. (`-f` is `force`, `-d` is `remove directories`) git clean -fd</p>
<p>The post <a rel="nofollow" href="https://sidecode.io/dev-blog/git-remove-unsaved-changes/">Git &#8211; Remove Unsaved Changes</a> appeared first on <a rel="nofollow" href="https://sidecode.io">SideCode</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>To remove all changes you made  and &#8220;reset&#8221; to the last commit</p>
<pre><code># Revert changes to modified files.
git reset --hard

# Remove all untracked files and directories. (`-f` is `force`, `-d` is `remove directories`)
git clean -fd</code></pre>
<p>The post <a rel="nofollow" href="https://sidecode.io/dev-blog/git-remove-unsaved-changes/">Git &#8211; Remove Unsaved Changes</a> appeared first on <a rel="nofollow" href="https://sidecode.io">SideCode</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/

Object Caching 33/136 objects using disk
Page Caching using disk: enhanced 
Database Caching 24/49 queries in 0.022 seconds using disk

Served from: sidecode.io @ 2026-04-23 15:17:53 by W3 Total Cache
-->