
# Get back saved state from stash (pop from stash stack) # Save you work (push to stack) and reset to the last clean state You want to combine those two afterwards. Say you have an old repository and due to infrastructure it gets pushed to a new one but without preserving the history. Merge two repositories together for the same project Create new repository and add it as the new origin: git remote set-url origin /repo.git.Filter: git filter-branch -prune-empty -subdirectory-filter dir/to/keep/ branchToKeep.Git push -u origin master # Push and set upstream (-> `-u`) Split subfolder of a repository into a separate repositoryįollow this guide: /github/using-git/splitting-a-subfolder-out-into-a-new-repositoryīasically you apply git filter-branch on the desired branch and (sub)folder, change the origin and push to the new repository: Git remote add origin # Add repo URL to remotes Origin (widely used) is just a name (the alias). Remotes are simply an alias storing the url of repositories. Get total commit count of an already checked-out repo: git log -oneline -all | wc -l (last one is a lowercase L).git mv : like the normal mv -> rename and/or move files (safer and better than just mv).No requirement to name the remote repository origin: in fact the same repository could have a different alias for another developer git push origin branchname : push to origin repository.git rm -cached mylogfile.log or for directories git rm -cached -r mydirectory : Remove file wihtout deleting local copy.This does not suit our quality standards. Copy a folder (including its history) from a repository to another.What was introduced by the other commit.
#GITBOOK EDITOR NO BRANCH FOUND UPDATE#
Update commit status of submodules in super repo.Get submodule contents after super repo checkout.Clean-up local branches deleted on remote.Merge master into feature branch (update feature with master's state).Enter/change/switch to branch or to a specific commit.Mark files back as unstaged (undos last commit message!).Pushed commit which is not the most recent.Damn! I forgot something in my commit message.Review changes before commit (show uncommitted changes).Merge two repositories together for the same project.Split subfolder of a repository into a separate repository.
