4. Set Global Git Name and Username
• Every commit requires to know who is the user committing
• So, we need to setup global Name and Username. This is onetime
process
• $ git config --global user.name 'Your Name'
• $ git config --global user.email you@somedomain.com
5. Commit files added in git index
• $ git commit --message “Your Initial Commit Message”
6. Add remote
• Till now all files added and committed are saved on local system
• You may want to move those files to server, Before that we need to
add servers in remote list of git
• $ git remote add <AnyUniqueName> <gitpath>
• Note : Mostly “origin” is used for remote name
• Example : git remote add origin https://github.com/user/repo.git
8. How Authentication works for remote
• To push anything on remote Git server, we need to authenticate our
self.
• For this, we need to generate RSA key and store in remote git server.
This is only one time process. You can refer below articles
• Generate RSA key using Eclipse
• Creating First Application in Heroku using Eclipse
• Working with Git on Window
• How to add public key in Bit bucket
9. Push Changes
• Once remote repository is added we can push changes from local to
remote repository
• To check available remote repositories run - $git remote
• $ Git push <RemoteNameAdded> <localBranchName>
• Example : git push origin master
10. Push Fast Forward (Not Recommended)
• You may get an error about fast-forward while committing to remote
repository. This is because you remote repository already have some
file which is not in synch with your local repository
• Correct solution is to fetch from remote repository, merge and then
try to commit again
• However, in case you want to overwrite [Yes, Overwrite means you
cannot see any history] remote files we can use “-fast” attribute
• Example : git push origin master --fast