-
-
Save jorwan/602e07d2bcd7828f5659 to your computer and use it in GitHub Desktop.
Revisions
-
frangeris revised this gist
Apr 15, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ Common git commands =================== This is a list of useful commands for git for fast search and ops developers, enjoy and comments for suggest all welcomes :D ------------- Public repo .tar for download versions: -
frangeris revised this gist
Apr 15, 2015 . 2 changed files with 124 additions and 44 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,124 @@ Common git commands =================== Hey! I'm your first Markdown document in **StackEdit**[^stackedit]. Don't delete me, I'm very helpful! I can be recovered anyway in the **Utils** tab of the <i class="icon-cog"></i> **Settings** dialog. ------------- Public repo .tar for download versions: [https://www.kernel.org/pub/software/scm/git/](https://www.kernel.org/pub/software/scm/git/) **Delete with git all files listed as deleted:** ```sh $ git rm $(git ls-files --deleted) ``` **Delete a branch DOWN in the local repository:** ```sh $ git branch [branch name] --delete ``` **Delete a branch UP in the services repository:** ```sh $ git push origin --delete [branch name] ``` **Do not track changes on specific file:** ```sh $ git update-index --assume-unchanged [file] ``` **Track changes again:** ```sh $ git update-index --no-assume-unchanged ``` **List hidden tracked files:** ```sh $ git ls-files -v | grep '^[[:lower:]]' ``` **Cleaning up cache when git ignore fail (options):** ```sh $ git rm -r --cached . $ git add . $ git commit -m "Fixed untracked files" ``` **Clone a repo specifying the branch:** ```sh $ git clone -b <branch> <myproject>.git ``` **Ignore mode file change, setting up git:** ```sh $ git config core.fileMode false ``` **git checkout, doesn't work... possibilities:** ```sh $ git config --global core.autocrlf false $ vim .gitattributes # comment line "* text=auto" ``` **Setting up git color:** ```sh $ git config --global color.ui true ``` **Rolling back a commit:** ```sh $ git reset --soft 'HEAD^' ``` **Discard last commit:** ```sh $ git reset HEAD --hard $ git reset --hard origin/master ``` **Merging conflicts (accept theirs):** ```sh $ git checkout --theirs ``` **Merging conflicts (accept ours):** ```sh $ git checkout --ours ``` **Remove a remote:** ```sh $ git remote rm <remote> ``` **Resolve problem with CRLF sequence:** ```sh $ git diff --ignore-space-at-eol ``` **Add just tracked files to the stage:** ```sh $ git add -u . ``` **Revert changes on a specifuc file commited and begin again:** ```sh $ git checkout commit-reff~1 -- <file name> ``` **Remove the last commit and set the change to "Changed but not updated":** ```sh $ git reset HEAD~1 ``` **Export a "clean" project:** ```sh $ git archive master | tar -x -C </somewhere/else> $ git archive master | bzip2 > <source.tar.bz2> $ git archive --format zip --output <zipfile.zip> master ``` > **Note:** This is a synonym to svn export. What this does is export and compress a repository without any .git* files. **Removing file from all history:** [https://help.github.com/articles/remove-sensitive-data/](https://help.github.com/articles/remove-sensitive-data/) This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,44 +0,0 @@ -
frangeris renamed this gist
Apr 15, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
frangeris renamed this gist
Apr 15, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
frangeris revised this gist
Feb 23, 2015 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -24,6 +24,7 @@ GIT [IGNORE MODE FILE] git config core.fileMode false [CHECKOUT DOESN'T WORK] git config --global core.autocrlf false vim .gitattributes # comment line "* text=auto" [GIT COLOR] git config --global color.ui true -
frangeris revised this gist
Jan 16, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ GIT === [PUBLIC REPO .tar] https://www.kernel.org/pub/software/scm/git/ [DELETE ALL RM] git rm $(git ls-files --deleted) -
frangeris revised this gist
Jan 16, 2015 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -39,3 +39,5 @@ GIT [REMOVE REMOTE] git remote rm <remote> [PROBLEM CRLF SEQUENCE] git diff --ignore-space-at-eol [REMOVE FILE FROM ALL HISTORY] https://help.github.com/articles/remove-sensitive-data/ -
frangeris revised this gist
Sep 10, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,7 @@ GIT [TRACK CHANGES] git update-index --no-assume-unchanged <file> [LIST HIDDEN TRACKS] git ls-files -v | grep '^[[:lower:]]' [CLEANING UP CACHE WHEN GIT IGNORE FAIL] git rm -r --cached . -
frangeris revised this gist
Sep 10, 2014 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -37,3 +37,5 @@ GIT [ACCEPT OURS MERGE] git checkout --ours [REMOVE REMOTE] git remote rm <remote> [PROBLEM CRLF SEQUENCE] git diff --ignore-space-at-eol -
frangeris revised this gist
Aug 20, 2014 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,7 @@ GIT === [PUBLIC REPO] https://www.kernel.org/pub/software/scm/git/ [DELETE ALL RM] git rm $(git ls-files --deleted) [DELETE BRANCH DOWN] git branch <branchName> --delete -
frangeris revised this gist
Aug 13, 2014 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -10,6 +10,8 @@ GIT [TRACK CHANGES] git update-index --no-assume-unchanged <file> [LIST TRACKS] git ls-files -v | grep '^[[:lower:]]' [CLEANING UP CACHE WHEN GIT IGNORE FAIL] git rm -r --cached . git add . -
frangeris revised this gist
Aug 12, 2014 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -26,6 +26,7 @@ GIT [ROLLING BACK A COMMIT] git reset --soft 'HEAD^' [DISCARD LAST COMMIT] git reset HEAD --hard git reset --hard origin/master [ACCEPT THEIRS MERGE] git checkout --theirs -
frangeris revised this gist
Jul 27, 2014 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -6,9 +6,9 @@ GIT [DELETE BRANCH UP] git push origin --delete <branchName> [DONT TRACK CHANGES] git update-index --assume-unchanged <file> [TRACK CHANGES] git update-index --no-assume-unchanged <file> [CLEANING UP CACHE WHEN GIT IGNORE FAIL] git rm -r --cached . -
frangeris revised this gist
Jul 25, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -17,7 +17,7 @@ GIT [CLONE BRANCH] git clone -b <branch> git@<domain>:<user>/<myproject>.git [IGNORE MODE FILE] git config core.fileMode false [CHECKOUT DOESN'T WORK] git config --global core.autocrlf false -
frangeris revised this gist
Jul 25, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ GIT [DONT TRACK CHANGES] git update-index --no-assume-unchanged <file> [CLEANING UP CACHE WHEN GIT IGNORE FAIL] git rm -r --cached . git add . git commit -m "Fixed untracked files" -
frangeris revised this gist
Jul 8, 2014 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -30,3 +30,5 @@ GIT [ACCEPT THEIRS MERGE] git checkout --theirs [ACCEPT OURS MERGE] git checkout --ours [REMOVE REMOTE] git remote rm <remote> -
frangeris revised this gist
May 7, 2014 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -26,3 +26,7 @@ GIT [ROLLING BACK A COMMIT] git reset --soft 'HEAD^' [DISCARD LAST COMMIT] git reset HEAD --hard [ACCEPT THEIRS MERGE] git checkout --theirs [ACCEPT OURS MERGE] git checkout --ours -
frangeris revised this gist
Apr 5, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ GIT [DONT TRACK CHANGES] git update-index --no-assume-unchanged <file> [CLEANING UP CACHE] git rm -r --cached . git add . git commit -m "Fixed untracked files" -
frangeris revised this gist
Apr 5, 2014 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -24,3 +24,5 @@ GIT [GIT COLOR] git config --global color.ui true [ROLLING BACK A COMMIT] git reset --soft 'HEAD^' [DISCARD LAST COMMIT] git reset HEAD --hard -
frangeris revised this gist
Mar 24, 2014 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -22,3 +22,5 @@ GIT [CHECKOUT DOESN'T WORK] git config --global core.autocrlf false [GIT COLOR] git config --global color.ui true [ROLLING BACK A COMMIT] git reset --soft 'HEAD^' -
frangeris revised this gist
Mar 24, 2014 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -20,3 +20,5 @@ GIT [IGNORE MODE] git config core.fileMode false [CHECKOUT DOESN'T WORK] git config --global core.autocrlf false [GIT COLOR] git config --global color.ui true -
frangeris revised this gist
Mar 21, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -19,4 +19,4 @@ GIT [IGNORE MODE] git config core.fileMode false [CHECKOUT DOESN'T WORK] git config --global core.autocrlf false -
frangeris revised this gist
Mar 21, 2014 . 1 changed file with 8 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,22 +1,22 @@ GIT === [DELETE ALL RM] git rm $(git ls-files --deleted) [DELETE BRANCH DOWN] git branch <branchName> --delete [DELETE BRANCH UP] git push origin --delete <branchName> [TRACK CHANGES] git update-index --assume-unchanged <file> [DONT TRACK CHANGES] git update-index --no-assume-unchanged <file> [.gitignore CLEANING UP] git rm -r --cached . git add . git commit -m "Fixed untracked files" [CLONE BRANCH] git clone -b <branch> git@<domain>:<user>/<myproject>.git [IGNORE MODE] git config core.fileMode false [CHECKOUT DO NOT WORK] git config --global core.autocrlf false -
frangeris revised this gist
Mar 21, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ GIT [.gitignore DONT] git update-index --no-assume-unchanged <file> [.gitignore CLEANING UP] git rm -r --cached . git add . git commit -m "Fixed untracked files" -
frangeris revised this gist
Mar 21, 2014 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -18,3 +18,5 @@ GIT [CLONE BRANCH] git clone -b <branch> git@<domain>:<user>/<myproject>.git [IGNORE MODE] git config core.fileMode false [CHECKOUT DO NOT WORK] git config --global core.autocrlf false -
frangeris revised this gist
Mar 21, 2014 . 1 changed file with 10 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,20 @@ GIT === [DELETE ALL RM] git rm $(git ls-files --deleted) [DELETE BRANCH DOWN] git branch <branchName> --delete [DELETE BRANCH UP] git push origin --delete <branchName> [.gitignore TRACK] git update-index --assume-unchanged <file> [.gitignore DONT] git update-index --no-assume-unchanged <file> [.gitignore] git rm -r --cached . git add . git commit -m "Fixed untracked files" [CLONE BRANCH] git clone -b <branch> git@<domain>:<user>/<myproject>.git [IGNORE MODE] git config core.fileMode false -
frangeris revised this gist
Mar 17, 2014 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,12 @@ GIT === [DELETE ALL RM] git rm $(git ls-files --deleted) [DELETE BRANCH DOWN] git branch <branchName> --delete [DELETE BRANCH UP] git push origin --delete <branchName> [.gitignore TRACK] git update-index --assume-unchanged <file> [.gitignore DONT] git update-index --no-assume-unchanged <file> [.gitignore] git rm -r --cached . git add . git commit -m "fixed untracked files" [CLONE BRANCH] git clone -b <branch> git@<domain>:<user>/<myproject>.git -
frangeris created this gist
Mar 17, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ GIT === [DELETE ALL RM] git rm $(git ls-files --deleted) [DELETE BRANCH DOWN] git branch <branchName> --delete [DELETE BRANCH UP] git push origin --delete <branchName> [.gitignore TRACK] git update-index --assume-unchanged <file> [.gitignore DONT] git update-index --no-assume-unchanged <file> [.gitignore] git rm -r --cached . git add . git commit -m "fixed untracked files" [CLONE BRANCH] git clone -b <branch> git@<domain>:<user>/<myproject>.git