<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Victor Adeshile</title>
    <description>The latest articles on DEV Community by Victor Adeshile (@davik4life).</description>
    <link>https://dev.to/davik4life</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F185132%2F1550d224-5b90-49cd-b09f-31ead500b424.jpeg</url>
      <title>DEV Community: Victor Adeshile</title>
      <link>https://dev.to/davik4life</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/davik4life"/>
    <language>en</language>
    <item>
      <title>Working with GIT</title>
      <dc:creator>Victor Adeshile</dc:creator>
      <pubDate>Thu, 14 Jan 2021 10:11:07 +0000</pubDate>
      <link>https://dev.to/davik4life/working-with-git-57l0</link>
      <guid>https://dev.to/davik4life/working-with-git-57l0</guid>
      <description>&lt;p&gt;Git is a powerful feature to help you keep version control of your files. &lt;/p&gt;

&lt;p&gt;As a developer, just as with everything, you want to make sure you get adequate information regarding a command before using it.&lt;/p&gt;

&lt;p&gt;So, my experience using git on VSCode brought about this writeup. &lt;/p&gt;

&lt;p&gt;Inasmuch as I was able to rectify the issue, this is one mistake I don't want to make with a gigantic codebase containing thousands of files. It can cause nightmares to be honest.&lt;/p&gt;

&lt;p&gt;So, I had been writing codes and pushing them to my repo on GitHub, then, I had the need to rename some of the files, this caused me to keep getting some errors on my git CLI each time I ran the command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I felt the need to sync all changes with my origin(git Repo).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Roadblock 1:&lt;/strong&gt; I was able to use&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;git rm file1.js&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
 and this worked fine, but I had a file named try&amp;amp;catch.js which I couldn't remove because git treated the &amp;amp; in the name differently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Roadblock 2:&lt;/strong&gt; In the course of only trying to remove the file which I wanted to be deleted, I did&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;git rm *&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
 and this removed all my files from my VSCode.&lt;/p&gt;

&lt;p&gt;I was in shock as I didn't know what to do next.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The solution to Roadblock1:&lt;/strong&gt; As you may have guessed that I changed the naming convention to something else, well that would have worked also, but I didn't do that. &lt;/p&gt;

&lt;p&gt;What I did was implemented the escape syntax before the &amp;amp; sign in the name so My git code was&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;git rm try\&amp;amp;catch.js&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
 and this worked awesomely!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The solution to Roadblock2:&lt;/strong&gt; I used&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;git reset&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
 and then&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;git ls-files -d -z | xargs -0 git checkout --&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
 and this restored back all my files for me.&lt;/p&gt;

&lt;p&gt;I have never been more disturbed with the tremendous work and documentations I have been pushing all this while to my repo only to have it wiped out with a single mistake.&lt;/p&gt;

&lt;p&gt;I hope you learn from my experience. I would share more of my coding journey and how I am able to master JavaScript by practicing, teaching, and most importantly pushing my codes and writeups to my GitHub using the GitHub commands.&lt;/p&gt;

&lt;p&gt;These are the things you would be doing the most as a developer.&lt;/p&gt;

&lt;p&gt;Like, share, Upvote, and give your honest feedback to help me create better content for you.&lt;/p&gt;

&lt;p&gt;You can also support me as a developer so I can spend more quality time providing you with awesome content that would help you become a better developer.&lt;/p&gt;

&lt;p&gt;You can now buy me a coffee: &lt;a href="https://www.buymeacoffee.com/WebtekMasters"&gt;https://www.buymeacoffee.com/WebtekMasters&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>vscode</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
