How to share code in git | Easy step |

How to share code in git


To share your code you create a repository on a remote server to which you will copy your local repository.


To minimize the use of space on the remote server you create a bare repository: one which has only the .git objects and doesn't create a working copy in the file system. As a bonus you set this remote as an upstream server to easily share updates with other programmers.


On the remote server:

git init --bare /path/to/repo.git


On the local machine:

git remote add origin ssh://username@server:/path/to/repo.git


(Note that ssh: is just one possible way of accessing the remote repository.)


Now copy your local repository to the remote:

git push --set-upstream origin master


Adding --set-upstream (or -u) created an upstream (tracking) reference which is used by argument-less Git

commands, e.g. git pull




1. How to install git in your PC. Git Installation step by step easy explation.

2. How to create your first repository, then add and commit files in git step by step.  

3. How to Clone a repository in git. 

4. How to Share a code trough git. 

5. How to Setting your user name and email in git.

6. How to Setting up the upstream remote in git.

7. How to Learn about a command in git.

8. How to Set up SSH for Git. 

Post a Comment

0 Comments