Squash commits into one with Git, Rebase
Steps:
1. Update branchegit reset --hard origin/features/BRANCHNAME
OR
git pull origin features/BRANCHNAME
Steps:
1. Update branchegit reset --hard origin/features/BRANCHNAME
OR
git pull origin features/BRANCHNAME
The official tutorial is hear : https://about.gitlab.com/installation/#debian?version=ce
CE or EE : https://about.gitlab.com/installation/ce-or-ee/?distro=debian
Completely reset
Delete the .git
directory locally.
Recreate the git repository:
$ cd (project-directory)
$ git init
$ (add some files)
$ git add .
$ git commit -m 'Initial commit'
To force usage of a specific key, put in your ~/.ssh/config file :
Host [HOST_NAME]
Hostname [HOST_NAME]
User [USER_NAME]
Port [PORT]
IdentityFile ~/.ssh/[your_private_key]
Example:
This is an example to merge 2 last commits.
1. git rebase -i HEAD~2
2. Change pick to squash the commit you want to merge
3. Save and Exit
4. git push -f origin master
return code 22 fatal: git-http-push failed
git tag THE_TAG_NAME
git push --tags
git tag
git tag <TAGNAME>
git push origin <TAGNAME>
git push --tags
git tag -l
git checkout tags/<TAGNAME>
git tag -d <TAGNAME>
This is the brute-force method. It also removes the configuration of the repository.
Step 1: remove all historyrm -rf .git