Skip to content

Instantly share code, notes, and snippets.

View JustATestName144's full-sized avatar

Viacheslav Kyrychenko JustATestName144

  • Donetsk
View GitHub Profile
@JustATestName144
JustATestName144 / gist:877285d72b4ceca0cae968b8e8caf496
Created January 16, 2018 13:42
Git. Checkout remote branch which doesn't exist in a local repository.
git fetch origin
git checkout --track origin/<remote_branch_name>
@JustATestName144
JustATestName144 / Git. Remove cached file.
Created January 30, 2018 06:06
If you already have a file checked in, and you want to ignore it, Git will not ignore the file if you add a rule later. In those cases, you must untrack the file first, by running the following command in your terminal:
git rm --cached FILENAME
@JustATestName144
JustATestName144 / gist:422e3273d551205524231889445c5fd5
Created January 30, 2018 06:07
Git. Create a global .gitignore. You can also create a global .gitignore file, which is a list of rules for ignoring files in every Git repository on your computer. For example, you might create the file at ~/.gitignore_global and add some rules to it.
Create a global .gitignore
@JustATestName144
JustATestName144 / gist:72ff5c7d08cc2921c84b5c82a7b676c7
Created February 13, 2018 08:01
Git. Push branch to remote.
git push -u origin <branch>