發表文章

目前顯示的是有「git」標籤的文章

git設定位置

Local: /.git/config – Repository-specific settings. Global: /.gitconfig – User-specific settings. This is where options set with the --global flag are stored. System: $(prefix)/etc/gitconfig – System-wide settings. 有時候懶得下指令可以用copy/edit檔案來改比較快

don't name git branch as 'tag'

$ git push fatal: The current branch tag has no upstream branch. To push the current branch and set the remote as upstream, use     git push --set-upstream origin tag $ git push --set-upstream origin tag fatal: tag shorthand without <tag> use this command instead git push --set-upstream origin tag:tag

github delete remote branch/tag

https://help.github.com/articles/pushing-to-a-remote/ delete remote branch git push <REMOTENAME> : <BRANCHNAME>   However, here, you're telling Git to push nothing into BRANCHNAME on REMOTENAME . Because of this, git push deletes the branch on the remote repository.        delete remote tag https://stackoverflow.com/questions/5480258/how-to-delete-a-git-remote-tag github的tag一定是 create time,無法push過去的tag

Git 筆記 note

找戰犯指令,看是誰改了某個檔案 (可指定行數) git blame -L 5,10 index.html git我想用加入某個branch中某個commit,要怎麼做 git cherry-pick  問完就想到keyword了w git commit message的寫法,可以參考OBS, x264 OBS有說明格式 git push origin test:master https://git-scm.com/docs/git-rebase 看ref git reflog git show-ref git rm -cached  只從git內砍掉,保留檔案 --cached     Use this option to unstage and remove paths only from the index. Working tree files, whether modified or not, will be left alone. 更新submodule,如果不下--remote,會用本地的sha checkout git submodule update --init --recursive --remote tag只是pointer to hash類似branch的概念,但不一定要在branch上 這樣可以只推tag出去 git tag -a tagname -m 'tagmessage' commithash git push --tags git rebase -root 可以從branch最初的紀錄開始w 使用者資訊 For just one repo: git config user.name "Your Name Here" git config user.email your@email.com For (global) default email (which is configured in your ~/.gitconfig): git config --global user.name "Your Name Here" git config --global user.email your@em...