About
An article that takes the basic steps in order to set up a Git repository
Articles Related
Steps
Repository Init
When you want to set up a repository, you face generally two options:
- you want to create a fresh install from a Git repository
- or you have already a project containing code files
Clone git repository
In this case, you just have to clone the repository.
git clone https://github.com/gerardnico/myRepo.git
Create a Git repository for an existing code base
- Go to Github and create your repository
- Go to your local map where your project file resides and init a new repository
cd myProjectMap
git init
git remote add origin https://github.com/gerardnico/myRepo.git
git remote -v # Verification of the URL
- Pull the code in your local repository
git pull origin master
- Verify that Git see your local file as new. What is the Git File Status?
git status
- Add them all to the next commit
git add -A
git commit -m "First Commit"
- Push and set the default repo
git push --set-upstream origin master
Counting objects: 16, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (13/13), done.
Writing objects: 100% (16/16), 10.06 KiB | 0 bytes/s, done.
Total 16 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To https://github.com/gerardnico/myRepo.git
82d4c6e..0822d6f master -> master
Branch master set up to track remote branch master from origin.
- Done