This tutorials is basically aimed for the users who are learning about uploading their first project (repository) in Github via version control tool called Git. It’s obvious that confusion hover around you when you’re just getting started with git.
Git is a version control system aimed to handle project at speed, data integrity, and support for distributed, non-linear workflows.
a. First, you need to make sure that you’d installed Git – Fast Version Control
b. Then, login to your github account and create a new repository.
In the following screen you can copy it down where you need it if you click the button (right side of screen) to “clone in desktop”.
d. From here you run the following commands to “connect” your existing project to your repo on github. (This is assuming that you created your repo on github and it is currently empty)
e. Go to your local project folder then Right click > Git Bash Here (Open Git in Console Mode).
Now, you need to follow following steps.
1. Initialize Git
// This will start monitoring your changes (logs in .git folder)
2. Add files and folders
git add .
// . [dot] will add all your files & folders
3. Commit Changes
git commit -m “This is my initial commit”
// This will records changes to the repository
4. Add Remote Origin
git remote add origin https://github.com/bjungbogati/my-project-url.git
// creates a new remote called origin located at my-project-url
5. See Linked Repo
git remote -v
// see your linked repository
// checks the current state of the repository (optional)
6. Push Changes to Github
git push -f origin master
// -f is short version of –force
// push the commits in the local branch named master to the remote named origin (github)
Note: You’ll also be requested to signin to Github account.
git init git add . git commit -m "This is my initial commit" git remote add origin https://github.com/uname/url.git git remote -v git push -f origin master