Last active
May 22, 2020 21:49
-
-
Save Farrukhraz/5b50da7be32e4355eaca4e2ae1874b88 to your computer and use it in GitHub Desktop.
Git commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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