Last active
January 26, 2021 08:51
-
-
Save igorpronin/5ece1a8dbc0da6a63705 to your computer and use it in GitHub Desktop.
Git commands, Git usage
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
Перенес все в мой ман: https://github.com/igorpronin/my-mans/blob/master/git/_git.md | |
git config --global user.name "User Name" // set user name | |
git config --global user.email "[email protected]" // set user email | |
git config --list // show active settings | |
git help commit // open git manual in browser | |
cd c:/targetdir // change directory | |
git init // create git repository in this directory or reinit existing | |
git status // show info about files status (untracted / unmodified etc) | |
git add . // add all files to unmodified status | |
git commit -m "Comment" // commit files | |
git remote add origin https://github.com/user/repositoryName // set remote repository | |
git push -u origin master // add files to remote repository to master brunch | |
git clone https://github.com/username/repository.git // clone repository files to this directory | |
git remote // show names of remote servers | |
git remote -v // show urls of remote servers | |
git remote set-url <servername> https://... // set new url to remote server "servername" | |
git pull origin master //pull repository | |
// log variants | |
git log --pretty=oneline | |
git log --all --pretty=format:"%h %cd %s (%an)" --since='7 days ago' | |
git log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short // this one is good | |
Location .gitconfig in Windows : | |
c:\users\user\.gitconfig | |
for use aliases include them into .gitconfig | |
alias usage example: | |
[alias] | |
psh = git push -u origin master | |
tip: copy from bufer to git bash - ctrl + Ins | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment