Init from the scratch
|
$> mkdir /path/to/your/project $> cd /path/to/your/project $> git init $> git remote add origin https://Bravehartk2@bitbucket.org/Bravehartk2/magento-versions.git $> git fetch |
First checkout
|
$> git checkout origin/master $> git pull origin master |
Push to an existing repo
|
$> cd /path/to/my/repo $> git remote add origin https://Bravehartk2@bitbucket.org/Bravehartk2/magento-versions.git $> git push -u origin --all # pushes up the repo and its refs for the first time $> git push -u origin --tags # pushes up any tags |
Copy reposetory to copy a local reposetory to an external one (PUSH)
|
$> cd /path/to/my/repo $> git remote add origin https://User@bitbucket.org/User/reposetoryname.git $> git push -u origin --all # to push changes for the first time |
Force branch / commit
|
$> git fetch --all $> git reset --hard origin/master [Rev-SHA] $> git fetch //downloads the latest from remote without trying to merge or rebase anything. Then the git reset resets the master branch to what you just fetched. |
Change user: To change the user that interacts width the reposetory:
|
$> git config --global user.name "Billy Everyteen" # Set a new name $> git config --global user.name # Verify the setting # Billy Everyteen |
Delete remote branch:
|
$> git push origin --delete <BRANCH> |
Delete all remote branches
|
$> git branch --merged | grep -v \* | xargs git push origin --delete |
This […]