What do you want to save?
Add Code snippet
New code examples
-
Shell/Bash 2021-11-13 18:43:28
git how to work with remote branch and fork
Step 1) Checkout new branch `git checkout -b new-branch` Step 2) Make changes Step 3) Add to git `git add .` Step 4) Commit `git commit -m "Made changes!"` or `git commit -a` Step 5) Push to your repo `git push origin new-branch` Step 6) Make PR... Add solution -
TypeScript 2021-11-12 19:21:11
squash commits on branch
$ git rebase -i HEAD~4 At the interactive screen that opens up, replace pick with squash at the top for all the commits that you want to squash. Save and close the editor through esc --> :wq $ git push origin branch-name --force Add solution -
Shell/Bash 2021-11-12 13:12:10
Change a branch name in a Git repo
# Start by switching to the local branch which you want to rename: git checkout <old_name> # Rename the local branch by typing: git branch -m <new_name> # At this point, you have renamed the local branch. # If you’ve already pushed th... Add solution -
Other 2021-11-10 23:37:17
git push empty directories
gitkeep@example: ~$ mkdir empty-directory gitkeep@example:~$ cd empty-directory gitkeep@example:~$ touch .gitkeep gitkeep@example:~$ git add . gitkeep@example:~$ git commit -m "Commit empty folder in Git with gitkeep" gitkeep@example:~$ git push... Add solution