Skip to content

Instantly share code, notes, and snippets.

@Farrukhraz
Last active May 22, 2020 21:49
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 Farrukhraz/5b50da7be32e4355eaca4e2ae1874b88 to your computer and use it in GitHub Desktop.
Save Farrukhraz/5b50da7be32e4355eaca4e2ae1874b88 to your computer and use it in GitHub Desktop.
Git commands
git config --global user.name [name] # set up user name
git config --global user.email [email] # set up user email
git config --global color.ui auto # if git command returns error msg. Msg will be highlighted red
git init # initialize repo
git remote add origin https://github.com/Farrukhraz/folder.git # synchronize local and remote repo's
git remote -v # check if synchronization is done
git status # current status
git add . # to include in what will be commited
git rm --cached <file>/. # to unstage a file/all files
git restore <file>/. # to discard changes in working dir
git commit -m "what chandges has been done" # make a commit with a msg
git commit -am "what chandges has been done" # git add + git commit -m 'smth'
.gitkeep # let empty folder to be commited. The ".gitkeep" file must be
# saved in empty folder
.gitignore # ignore file/folder and doesn't include it in to commit.
# "file_name" for files; "folder/" for folders.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment