Skip to content

Instantly share code, notes, and snippets.

@imralpharvin
Last active September 13, 2020 19:34
Show Gist options
  • Save imralpharvin/ea816836f8b915285b55afbb82b3c58c to your computer and use it in GitHub Desktop.
Save imralpharvin/ea816836f8b915285b55afbb82b3c58c to your computer and use it in GitHub Desktop.
Git commands notes

Git commands

Install git:

https://git-scm.com/downloads

Clone a repository:

git clone [link of repository]

Add files to commit:

git add [files]
git add -A (all files and deletions)

Commit files:

git commit -m ""

Setting email address for every repository:

git config --global user.email "[email protected]"

Push files:

git push

To ignore files or folders:

.gitignore

To know user

git config user.name

To know details about account:

git config -- list

To add branch

git branch nameofbranch

To see branches:

git branch

To change branch:

git checkout nameofbranch
branches

To override master from other branch:

git checkout otherbranch
git merge -s ours master
git checkout master
git merge otherbranch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment