Professional Documents
Culture Documents
Git Basic Usage
Git Basic Usage
Installation
Download and install git for your OS (Windows, Linux or Mac OS X)
https://git-scm.com/downloads
Open a command line prompt and run:
$ git --version
Set up an SSH key
1. Set up your default identity
$ ssh-keygen
$ ls ~/.ssh
2. Create a new-branch
Use a separate branch for each feature or issue you work on. After creating a branch, check it out
locally so that any changes you make will be on that branch.
$ cd <USER_HOME>
$ cd fa_repo
$ git checkout -b feature
Forking Workflow
Fork the repository
A fork is a copy of a repository. Forking a repository allows you to freely experiment with changes
without affecting the original project.
Fork your repo from https://bitbucket.org/jala_devops_02/fa_repo
All of these personal public repositories are really just a convenient way to share branches with other
developers.
Everybody should still be using branches to isolate individual features, just like in the Feature Branch
Workflow and the Gitflow Workflow.
In the Forking Workflow, they are pulled into another developer’s local repository, while in the Feature
Branch and Gitflow Workflows they are pushed to the official repository.
Syncing a fork - Configure a remote for a fork
1. List the current configured remote repository
$ git remote -v
2. Add new remote upstream repository that will synced with the fork
References
Ø https://git-scm.com/docs
Ø https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html
Ø https://confluence.atlassian.com/bitbucketserver0414/workflow-strategies-in-bitbucket-server-
895367612.html#WorkflowstrategiesinBitbucketServer-CentralizedWorkflow
Ø https://www.atlassian.com/git/tutorials?_ga=2.119128393.1783786947.1564496731-
1459781296.1564189717
Ø https://www.atlassian.com/git/tutorials/git-forks-and-upstreams
Ø https://www.atlassian.com/git/tutorials/git-forks-and-upstreams