...
If you are using the Skara CLI tools then and have the branch you want to publish currently checked out, then you can just run the command git publish
Can I see the currently checked out local branch in my Bash prompt?
Yes, add the following to your ~/.bashrc
:
Code Block | ||
---|---|---|
| ||
git_branch() {
BRANCH="$(git symbolic-ref --short HEAD 2>/dev/null)"
if [ "${BRANCH}" != "" ]; then
printf " (${BRANCH}) "
else
printf ""
fi
}
PS1="${PS1}\$(git_branch)" |
For more information on how to customize your Bash prompt, see the Arch Linux wiki for a good reference.
Can I see the currently checked out local branch in my Zsh prompt?
Yes, add the following to your ~/.zshrc:
Code Block | ||
---|---|---|
| ||
autoload -Uz vcs_info
precmd_vcs_info() { vcs_info }
precmd_functions+=( precmd_vcs_info )
setopt prompt_subst
PROMPT="$PROMPT\$vcs_info_msg_0_"
zstyle ':vcs_info:git:*' formats ' (%b) '
zstyle ':vcs_info:*' enable git |
For more information, see the Pro Git book on Zsh.
GitHub
Configuration
How do I setup two-factor authentication (2FA)?
...
Code Block | ||
---|---|---|
| ||
$ git clone github.com:openjdk/jdk $ git clone github:openjdk/jdk $ git clone gh:openjdk/jdk |
Shell
Bash
Can I see the currently checked out local branch in my prompt?
Yes, add the following to your ~/.bashrc
:
Code Block | ||
---|---|---|
| ||
git_branch() {
BRANCH="$(git symbolic-ref --short HEAD 2>/dev/null)"
if [ "${BRANCH}" != "" ]; then
printf " (${BRANCH}) "
else
printf ""
fi
}
PS1="${PS1}\$(git_branch)" |
For more information on how to customize your Bash prompt, see the Arch Linux wiki for a good reference. For more Git information in your prompt, see contrib/completion/git-prompt.sh.
Can I get auto-completion for git commands?
Yes, on all of GNU/Linux, macOS and Windows this is provided out of the box when you install Git. If you want to install auto-completion manually, run the following commands:
Code Block | ||
---|---|---|
| ||
$ curl -o ~/.git-completion.bash https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
$ echo 'source $HOME/.git-completion.bash' >> ~/.bashrc |
Zsh
Can I see the currently checked out local branch in my Zsh prompt?
Yes, add the following to your ~/.zshrc
:
Code Block | ||
---|---|---|
| ||
autoload -Uz vcs_info
precmd_vcs_info() { vcs_info }
precmd_functions+=( precmd_vcs_info )
setopt prompt_subst
PROMPT="$PROMPT\$vcs_info_msg_0_"
zstyle ':vcs_info:git:*' formats ' (%b) '
zstyle ':vcs_info:*' enable git |
For more information, see the Pro Git book on Zsh.
Can I get auto-completion for git commands?
Yes, Zsh ships with auto-completion for Git out of the box. Enable auto-completion by adding the following line to ~/.zshrc
:
Code Block | ||
---|---|---|
| ||
$ echo 'autoload -Uz compinit && compinit' >> ~/.zshrc |