• Home
    • View
    • Login
    This page
    • Normal
    • Export PDF
    • Page Information

    Loading...
  1. Dashboard
  2. Undefined Space
  3. Skara
  4. FAQ

Page History

Versions Compared

Old Version 16

changes.mady.by.user Erik Helin

Saved on Mar 09, 2020

compared with

New Version 17

changes.mady.by.user Erik Helin

Saved on Mar 09, 2020

  • Previous Change: Difference between versions 15 and 16
  • Next Change: Difference between versions 17 and 18
  • View Page History

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
$ git config --global core.editor "vim"

Repositories

Cloning

How do I clone a repository?

Code Block
languagebash
$ git clone <URL>

How do I clone using SSH?

Make sure you have uploaded an SSH key to your GitHub account and then run:

...

Code Block
languagebash
$ git clone git@github.com:openjdk/jdk.git

How should I structure my local clones of repositories?

A common way of structuring local repositories is by following the domain name and path convention. For an example, see below:

Code Block
languagebash
$ tree
.
├── git
│   └── github.com
│       ├── edvbld
│       │   ├── jdk
│       │   └── loom
│       └── openjdk
│           ├── jdk
│           ├── loom
│           └── valhalla
└── hg
    └── hg.openjdk.java.net
        ├── code-tools
        │   └── jtreg
        └── jdk
            └── jdk

Can I have multiple local clones of a repository?

Yes, this is supported, supply a second argument to git clone stating the directory name of the local repository:

Code Block
languagebash
$ git clone <URL> <DIRECTORY>

Branches

How do I create a local branch?

Code Block
languagebash
$ git checkout -b <NAME-OF-BRANCH>

If you are using Git version 2.24 or newer you can also use the command: git switch --create <NAME-OF-BRANCH>

What should I name my local branches?

A common way of structuring your local branches is to name them after the issue they correspond to, for example JDK-8237566.

...

The currently checked out branch has an asterisk ("*") next to it.

How do I visualize branches in a graph?

Code Block
languagebash
$ git log --format=oneline --graph --all

How do I switch to another branch?

Code Block
languagebash
$ git checkout <NAME-OF-OTHER-BRANCH>

If you are using Git version 2.24 or newer you can also use the command: git switch <NAME-OF-OTHER-BRANCH>

Can I have different branches checked out in different local

...

clones of the same remote repository?

Yes, this is supported. If you prefer to have one local repository per issue you are working on, then you would have a local repository and a local branch per issue you are working on. For example:

...

Overview
Content Tools
ThemeBuilder

Terms of Use
• License: GPLv2
• Privacy • Trademarks • Contact Us

Powered by a free Atlassian Confluence Open Source Project License granted to https://www.atlassian.com/software/views/opensource-community-additional-license-offer. Evaluate Confluence today.

  • Kolekti ThemeBuilder Powered by Atlassian Confluence 8.5.21
  • Kolekti ThemeBuilder printed.by.atlassian.confluence
  • Report a bug
  • Atlassian News
Atlassian
Kolekti ThemeBuilder EngineAtlassian Confluence
{"serverDuration": 284, "requestCorrelationId": "afd4a4102f47b020"}