DevNet Associate DEVASC 200-901 Official Certification Guide by Adrian Iliesiu (z-lib.org)

(andrew) #1
# git remote rm origin
# git remote -v

In order for your code to be shared with the rest of your
team or with the rest of the world, you have to tell Git to
sync your local repository to the remote repository (on a
shared server or service like GitHub). The command git
push, which has the following syntax, is useful in this
case:


Click here to view code image


git push (remotename) (branchname)

This command needs a remote name, which is an alias
used to identify the remote repository. It is common to
use the name origin, which is the default if a different
name is not supplied. In addition, you can reference a
branch name with git push in order to store your files in
a separately tracked branch from the main repository.
(You can think of this as a repository within a
repository.) The sole purpose of the git push command
is to transfer your files and any updates to your Git
server. The following is an example of the git push
command in use:


Click here to view code image


# git push origin master
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 210 bytes | 210.00
KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://github.com/chrijack/devnetccna.git
* [new branch] master -> master
Branch 'master' set up to track remote branch
'master' from 'ori-
gin'.
Free download pdf