Git start

作者: Waste_Land | 来源:发表于2016-04-13 11:44 被阅读101次

Some headfirst instructions: (Chinese)http://www.techug.com/git-in-600-words
Git cheatsheet: (Chinese)http://www.jb51.net/article/55442.htm

Start

Change all names start with $ to your own word.
git init set current folder as a git repository
git add $README.md add a file (README.md) into git indexing table (your current branch), for further git commit & git push
git commit -m $first
git remote add $remotegit git@github.com:yourinfo.git add a remote url, for git push convenience (otherwise you have to type it all the time)
git branch $yourbranch create a branch, for different people's (or features') program progress.
git push $remotegit $yourbranch push your branch to github

TaDa! You finished! Let's checkout more git functions~

Further Start

git clone $. $../beta

Check configuration

Attention: Configurations is dependent to folder. (use ll -aht to list files, check whether a .git folder exists)
git ls-files list all indexing files (what you are going to commit & push)
git branch list all usable branch, current branch name starts with *
git remote list all usable remote url pointer
git remote show $remotegit show details of $remotegit

Configure configuration

index

git rm --cached $not4index remove file from git index table
git rm --f $deletefile remove file from git index & your computer

branch

git checkout $otherbranch change your current branch to $otherbranch
git branch -d $branch2delete delete a branch, use -D to force delete

remote

git remote remove
git remote rename

Git Stash

git stash save now branch changed things & switch branch, NOT commit (be careful what you commit, make commitment meaningful)
git stash list check all stash, for further applying or poping
git stash pop stash@{num} pop out & apply stash
git stash clear clear all stash
git stash apply stash@{num} apply stash & NOT delete from stash list

相关文章

网友评论

      本文标题:Git start

      本文链接:https://www.haomeiwen.com/subject/fkwwlttx.html