Skip to content

gelu77/git-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Git Commands

Init git repository

git init
git add README
git commit -m "first commit"
git remote add origin git://github.com/gelu77/MyRepo1.git

Clone from an existing git repository

git clone git://github.com/gelu77/MyRepo1.git

Commit the changes of tracked files

git commit -am "change for tracked files"

Push the local changes to remote repository

git push -u origin master

Pull the remote changes into the local repository

git fetch origin
git merge origin/master

Or the simple command

git pull origin

How do you discard unstaged changes in git?

git stash save --keep-index
git stash drop
git checkout path/to/file/to/revert
git checkout -- .
git clean -df & git checkout -- .

git: undo all working dir changes including new files

git reset --hard # removes staged and working directory changes
git clean -f -d # remove untracked files

Removing multiple files from a Git repo that have already been deleted from disk

git add -u
git ls-files --deleted | xargs git rm
git commit

About

git commands test

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published