1. Initialize git repo
git init
2. Set your user name
git config user.name "your username"
3. Set your checkin email identifier
git config user.email "your email address on github/bitbucket"
4. Add this folder structure to local git repo
git add .
5. When you are ready to commit
git commit --message "Commit Message / Ticket Number"
6. Up until this point, everything is local. Now lets add cloud repository (http or https)
git remote add origin https://username:password@github.com/accountname/reponame.git/ OR git remote add origin http://username@cloudrepoApp.com/accountname/reponame.git/ (for password prompt)
7. Push code up to cloud repo
git push -u origin master
At any point you have to change username or password you can use the following and next time when you push or pull, git will ask for new password.
On Windows git config --global credential.helper wincred On Mac git config --global credential.helper osxkeychain OR git config --global --unset user.password
Post a Comment