Coding tips

Clone only the latest commit of a Git repository

git clone --depth 1 <url>

If you need an specific commit, you can obtain it with the git checkout command:

git checkout <commit_hash>

Source

  1. Bing AI Chat, 21/9/2023.
  2. Copie un repositorio de git sin historial - QA Stack.
  3. Clonar repositorio remoto de git hasta cierto commit.
  4. Regresar un repositorio a un commit especifico - Stack Overflow.
  5. Atlassian Git Tutorial.

Edit Git Remote URL

git remote set-url origin <new-url>

Source

Django tests not running

Solution. Make sure you are writing your tests wrapped in classes that inherit from TestCase. Example:

from django.test import TestCase


class FooTest(TestCase):
    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_this_will(self):
        print 'Win'

Read more


Children
  1. Code Snippets
  2. Coding tips for the R programming language
  3. Julia
  4. Power Shell
  5. Python
  6. Ruby