Skip to content

Instantly share code, notes, and snippets.

@jtviegas
Last active March 26, 2020 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtviegas/37b2eaf76393ac359ad26e5950e721fc to your computer and use it in GitHub Desktop.
Save jtviegas/37b2eaf76393ac359ad26e5950e721fc to your computer and use it in GitHub Desktop.
git tweaks

remove the file only from the Git repository and not remove it from the filesystem:

git rm --cached file1.txt
git commit -m "remove file1.txt"

connect local project to remote repository

git init
git remote add origin https://github.com/yourusername/your-repo-name.git

view commits in specific branch, that was created from master

git log master..

If you are not in the branch:

git log master..branchname

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment