“télécommande git” Réponses codées

Obtenez URL à distance GIT

 git config --get remote.origin.url
Frantic Fly

Afficher le git distant

# If you require full output and you are on a network that can reach the remote repo where the origin resides 
git remote show origin
fast_and_the_curious

Origine à distance GIT

git remote add origin <repository url>	#add repository
git remote -v							#view your repositories
Graceful Grivet

Afficher le git distant

# when you are not connected to the network, you can use this
git config --get remote.origin.url
fast_and_the_curious

télécommande git

git remote #This has two part "origin" and "upstream"

# Adding origin
git remote add origin <The url of local github repository>

#Adding upstream
git remote add upstream <The url where you have forked repository>
Kumaran KM

télécommande git

# VIEW remote repo name & location to 'push' to & 'fetch' from
git remote -v
# ADD remote repo
git remote add <name> <url>
# REMOVE remote repo
git remote remove <name>
# RENAME remote repo
git remote rename <name> <new-name>

# EXAMPLE by steps to remove, add, and rename an existing github repo

# 1. VIEW if project already has remote repo
git remote -v
> origin  https://github.com/johndoe/my-repo.git (fetch)
> origin  https://github.com/johndoe/my-repo.git (push)

# 2. REMOVE the remote repo and (optional) confirm
git remote remove origin
git remote
# line should be blank

# 3. ADD new remote repo and confirm (should see 'origin')
git remote add origin https://github.com/johndoe/new-repo.git
git remote
origin

# 4. RENAME the remote repo to 'upstream'
git remote rename origin upstream
git remote
upstream

# NOTE: 'origin' is just a standard convention name, remote repos are
# named to use a shorthand instead of the long url   
Coffee Addict

Réponses similaires à “télécommande git”

Questions similaires à “télécommande git”

Plus de réponses similaires à “télécommande git” dans Shell/Bash

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code