Skip to content

marcoc2/git-notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

88925ee · Jul 10, 2018

History

11 Commits
Jul 10, 2018

Repository files navigation

git-notes

Common git commands

Fetch files from a submodule with a empty folder

$ git submodule update --init

Add external submodule

$ git submodule add url

Update repository recursively

$ git submodule update --recursive --remote

Reset a single file

$ git checkout HEAD -- my-file.txt

Merge (some-branch into master)

$ git checkout master

$ git merge some-branch

Remove modified files or working directories (staged for commit)

$ git reset --hard

Clean untracked files (not flagged for commit)

(CAUTION: Will delete files)

$ git clean -f -d # remove untracked

$ git clean -f -x -d # CAUTION: as above but removes ignored files like config.

$ git clean -fxd :/ # CAUTION: as above, but cleans untracked and ignored files through the entire repo (without :/, the operation affects only the current directory)

About

Common git commands

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published