After checking Upload my project to github I still have no idea how to get a project uploaded to my Git Hub repository.
I\'m new to GitHub and I have no idea what to
Then type the following Commands
git init
git add .
git commit -m "initial commit"
git remote add origin PASTE URL
git push -u origin master
Now check your GitHub account, Repository is successfully uploaded.
For Complete guidance, you can watch this video.
Download SourceTree. It is available for windows7+ and Mac and is highly recommend to upload files on github via interactive UI.
1.1 ls
It will show you default location.
1.2 CD "C:\Users\user\Desktop\HTML" We need to assign project path
1.3 git init It will initialize the empty git repository in C:\Users\user\Desktop\HTML
1.4 ls It will list all files name
1.5 git remote add origin https://github.com/repository/test.git it is your https://github.com/repository/test.git is your repository path
1.6 git remote -v To check weather we have fetch or push permisson or not
1.7 git add . If you put . then it mean whatever we have in perticular folder publish all.
1.8 git commit -m "First time"
1.9 git push -u origin master
I did as follows;
Of course you have to install git
I assume you are on a windows system like me and have GIT installed. You can either run these commands by simple command prompt in the project directory or you can also use GitBash.
Step 1: Create a repository in GIT manually. Give it whatever name you seem fit.
Step 2:
Come to your local project directory. If you want to publish your code to this new repository you just created make sure that in the projects root directory there is no folder name .git, if there is delete it.
Run command git init
Step 3:
Run command
git add .
step 4:
Run command
git commit -m YourCommitName
Step 5:
Run command
git remote add YourRepositoryName https://github.com/YourUserName/YourRepositoryName.git
Step 6:
Run Command
git push --set-upstream YourRepositoryName master --force
Please note that I am using the latest version of GIT at the time of writing. Also note that I did not specify any particular branch to push the code into so it went to master. In step 6 the GIT will ask you to authorize the command by asking you to enter username and password in a popup window.
Hope my answer helped.