Wednesday, December 13, 2017

How to export a local project to github repo?

Locally I have created a project and developed for few days. Now I want to add this project to my github arena.

Local Project Name: TestIt

Now I have to create a repo with same name. Please check the following:



Then go to my project directory and initialize like the following

HP@Al-Fateh MINGW64 /f/workspace/TestIt
$ git init
Initialized empty Git repository in F:/workspace/TestIt/.git/

HP@Al-Fateh MINGW64 /f/workspace/TestIt (master)
$ git remote add origin https://github.com/rizvi/TestIt

HP@Al-Fateh MINGW64 /f/workspace/TestIt (master)
$ git pull origin master
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
From https://github.com/rizvi/TestIt
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master

HP@Al-Fateh MINGW64 /f/workspace/TestIt (master)
$ git checkout -b br#201721 origin/master
Switched to a new branch 'br#201721'
Branch br#201721 set up to track remote branch master from origin.

HP@Al-Fateh MINGW64 /f/workspace/TestIt (br#201721)
$ git add .

HP@Al-Fateh MINGW64 /f/workspace/TestIt (br#201721)
$ git gui

Commit Message is also given here.

HP@Al-Fateh MINGW64 /f/workspace/TestIt (br#201721)
$ git push origin HEAD:br#201721
fatal: TaskCanceledException encountered.
   A task was canceled.
Username for 'https://github.com': rizvi
Counting objects: 31, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (19/19), done.
Writing objects: 100% (31/31), 5.08 KiB | 578.00 KiB/s, done.
Total 31 (delta 4), reused 0 (delta 0)
remote: Resolving deltas: 100% (4/4), done.
To https://github.com/rizvi/TestIt
 * [new branch]      HEAD -> br#201721

HP@Al-Fateh MINGW64 /f/workspace/TestIt (br#201721)

No comments:

Post a Comment