Knowledge learned from https://www.udacity.com/course/how-to-use-git-and-github--ud775
A blog: https://blog.udacity.com/2015/06/a-beginners-git-github-tutorial.html
A blog: https://blog.udacity.com/2015/06/a-beginners-git-github-tutorial.html
git command
- git clone [github link] [(optional)folder name]
- git log
- git log —stat
- git diff first_id secod_id
- git checkout
- q
- git config —global color.ui auto
Atom as Git commit editorgit config --global core.editor "atom --wait"
make a repository
git init
git status
git add
add new work to the staging area, a bridge b/w working directory and repositorygit add .
add all workgit commit
will open a text editor, write, save and close editor.git commit -m "message
no need to open text editorgit diff (empty)
git diff --staged
git reset --hard
git branch
git branch easy-mode
git checkout easy-mode
GitHub
git remote
git remote add origin url.git
set the url as your remote referencegit remote -v
stands for verbosegit push origin master
sync to remote by master branchgit pull origin master
sync local by master branchgit config --global credential.helper osxkeychain
password once for all
-git pull
=git fetch
+git merge
- pull request is actually merge request
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.