Git is one popular source control nowadays. I have worked with CVS, SVN and just now get to know git.
Things I have done so far:
I install it on my Windows 8 & Windows XP (32 bits):
- Download the Git for Windows installer package. I installed Git-1.8.3-preview20130601.exe
- I used all default installation instruction
- Local machine configuration:
Configure your username using the following command: git config --global user.name "FIRST_NAME LAST_NAME" Configure your email address using the following command: git config --global user.email "MY_NAME@example.com"
Some useful commands I started working with git
Add existing project to my git repository
- Go to git bash, Locally, change to the root directory of your existing source
- Initialize the directory under source control: git init
- Add the existing files to the repository: git add .
- Commit the files: git commit -m “message”
- Publish local repo to git server (ex: bitbucket or github)
git remote add origin ssh://email@example.com/username/yourrepo.git git push -u origin master
Some files or folders, we don’t want to upload to server so we ignore them from commit. Here are some commands I used:
- Add ignore file via Git bash: touch .gitignore
- Copy some default ignore from here
- Commit the file
Just for me, many things to learn about it
My first time, I might miss many things than above so please help to give me some guideline to master on git.
I feel I miss something and not quite sure.
What are the useful commands I should know more about git?
What’s else about it?
Please help to share in comment below to help me and other beginners as well.