Simple and easy guide for git beginners.
Getting Started – Installing Git
Create a new repository
Create a new folder, and open it,
Right click in the folder, choose “Git Bash Here”
$ git init
You may notice that there is now a hidden folder called .git in the folder.
Clone a checkout repository
$ git clone https://github.com/jibuas/tt
when using a remote server, your command will be
$ git clone username@host:/path/to/repository
Adding & Commiting
$ git add <filename>
$ git add *
for commit these changes use
$ git commit -m “Here is Commit Message”
Now the file is committed, but not in your remote repository.
Push changes to remote
Your changes are now in local working copy. To send those changes to your remote repository use:
$ git push origin master
‘master’ is the branch you want to push your changes.
A branch in Git is simply a lightweight movable pointer to one of these commits. The default branch name in Git is master. As you start making commits, you’re given a master branch that points to the last commit you made. Every time you commit, it moves forward automatically.
create a new branch named “branch_name”.
$ git checkout -b branch_name
switch back to master
$ git checkout master
and delete the branch again
$ git branch -d branch_name
push the branch to remote repository
$ git push origin <branch>
Update & Merge
Update your local repository
$ git pull
to merge another branch into your active branch
$ git merge <branch>
For More On Git Documentation