Skip to content

Instantly share code, notes, and snippets.

@maxcollombin
Created August 2, 2023 12:23
Show Gist options
  • Save maxcollombin/38ca815c314d5dbffb4a0a74061b2efe to your computer and use it in GitHub Desktop.
Save maxcollombin/38ca815c314d5dbffb4a0a74061b2efe to your computer and use it in GitHub Desktop.
Git useful commands

lists all the remote repositories associated with the local repository.

git remote -v

fetches all the changes made to the upstream remote repository to the local

git fetch upstream

This command merges the changes that were fetched in the previous step into the local repository's current branch. The --ff-only option ensures that the merge is only performed if it is a fast-forward merge, which means that the local branch has not diverged from the upstream branch.

git merge --ff-only upstream/main

Push the changes to the fork

git push origin main

shows details about the remote repository named origin

git remote show origin

display the forks of a repository

https://github.com/{username}/{repository}/network/members

really usefull command to clear a local copy of a repository

git rm --cached -r .
git reset --hard

Source: https://stackoverflow.com/questions/9976986/force-lf-eol-in-git-repo-and-working-copy

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