Bitbucket

Plan projects, work on code, test and implement

Create high-quality software with code review

Enable more efficient code review with pull requests. Create a merge checklist with named approvers and lead discussions directly in the source code with inline comments.

Frequent deployment with integrated continuous delivery

Bitbucket pipelines with deployments allow you to create, test and deploy with integrated CI/CD. Benefit from configuration as code and fast feedback loops.

Secure your workflow

Be sure your code is safe in the cloud with IP whitelisting and the required 2-step verification. Restrict access to specific users and control their actions with branch permissions and merge checks for quality code.

We are looking forward to you

Stefan Haller

+41 78 746 51 16
stefan.haller@linkyard.ch

Git Cheat Sheet

Basics

git –versionGet the version of git.
git initCreate empty git repo in specified directory.
git config user.nameDefine author name to be used for all commits.
git config user.emailDefine author email to be used for all commits.
git cloneClone repo located at <repo> onto local machine.
git statusList which files are staged, unstaged and untracked.
git addGet everything ready to commit.
git add index.htmlGet specific file ready to commit.
git commit -m „nachricht“Commit the staged snapshot.
git logDisplay the entire commit history.
git diffShow all local file changes in the working tree.
git push originPush the <branch> to the remote repo.

Branches

git branchList all branches in your repo.
git checkout -bCreate and checkout a new branch named <branch>
git branch -aList remote and local branches on the linkyard servers.
git checkoutCheckout to an existing <branch>
git push originPush the <branch> to the remote repo in the linkyard cloud.
git branch -mRename the current branch.
git branch -dDelete a local <branch>
git mergeMerge <branch> into the current branch.
git merge –abortAbort the merge, in case of conflicts.
git cherry-pick 37ec83cMerge a specific commit.
git push origin :Delete a remote <branch>.

Logs

git logShow commits.
git log –onelineShow one line summary of commits.
git log -3Show commit history of last three commits.
git log -pShow changes.
git log –graphShow history of commits as graph.
git log –stat –summaryShow stats and summary of commits.
git reflogShow a log of changes to the local repo’s HEAD.

Tags

git tagShow all tags.
git tag -a -m „anmerkung“Create an annotated tag.
git tagCreate a lightweight tag.
git push –tagsPush all tags to the remote repo.
git showShow the tag data of a specific tag.

Stashes

git stash listShow all stashes.
git stash save „stash name“ && git stashSave a change to stash.
git stash branchCreate branch from stash.
git stash popApply a stash.
git stash clearDeletes complete stash.

Reset

git reset HEADRemove <file> from staging area.
git resetReset staging area to match the recent commit.
git reset –hardReset staging area, working dir and overwrites all changes.
git clean -dfDelete untracked files and directories.
git clean -fDelete untracked files.

Compare

git diffCompare modified files.
git diff –stagedCompare modified files within the staging area.
git diff ..Compare two branches.
git diff 37ec83c..d8d152eCompare two specific commits.