git add filename
Git add-a This is to add all the modified or added files to the Repository (library)
git commit-m ' message '
Git checkout-b feature create and switch branches
To
add a remote library:
To associate a remote library, use the command git remote add origin [email protected]:path/repo-name.git
;
Once associated, use the command to git push -u origin master
push all the contents of the master branch for the first time;
Thereafter, after each local commit, you can use the command to push the git push origin master
latest changes whenever necessary
Git push Origin dev pushes the local branch to the remote branch dev
Git show hash file name see Recent changes to this file name
Git whatchanged View Recent Changes
如果是只用add 把文件提交到版本库中,那用下面的命令解决
git reset HEAD
或用 git rm --cached filename
如果你的文件add后,还commit到版本库中,那用下面命令
git rm 会把一个不想要的文件删除掉。再commit 后就会取消文件
git reset --hard HEAD^
当然往上100个版本写100个^比较容易数不过来,所以写成HEAD~100
git branch -d feature-vulcan 删除本地的分支
git branch -D feature-vulcan 强行删除分支
git reset--hard head^
Of course up to 100 versions write 100 ^ more easy to count, so write head~100
git remote-v viewing remote branch information
Common commands for Git