What do you want to save?
Add Code snippet
New code examples
-
Shell/Bash 2022-03-04 06:00:01
how to create git repository for vim
$ cd $ mv .vimrc .vim/vimrc $ echo "runtime vimrc" > .vimrc $ cd .vim $ git init $ echo "This is my Vim config." > README $ git add * $ git commit -m "My Vim config is versioned." $ git remote add origin https://github.... 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 -
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 -
TypeScript 2021-11-02 19:17:13
squash commits in remote 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-10-07 02:15:04
new repository github used
$ git init $ git add . # Adds the files in the local repository and stages them for commit. To unstage a file, use 'git reset HEAD YOUR-FILE'. $ git commit -m "First commit" # Commits the tracked changes and prepares them to be pushed to a rem... Add solution -
Shell/Bash 2021-10-03 05:01:07
delete remote branch
$ git push origin --delete feature/login Add solution -
Shell/Bash 2021-09-27 23:21:02
git create master branch in empty repository
# initialize your bare repo $ git init --bare test-repo.git # clone it and cd to the clone's root directory $ git clone test-repo.git/ test-clone Cloning into 'test-clone'... warning: You appear to have cloned an empty repository. done. $ cd test-clone ... Add solution