git config --global user.email gituserid.gmail.com
(or)
git config --global user.name "GitUsernameWithinQuotes"
-3.1. Password will be asked by raising a credential input popup after pushing code to remote atlast.
-3.2. To change git user need to remove autoset credentails in Control panel-->User accounts-->windows credentails manager"
To add local repository of git
4.1. Open git bash in the project folder (Make a directory using 'cd path' or 'cd -' [for previous path] or 'cd /' - [for into root directory])
4.2. > git init - use within directory: to start git intilization locally.
4.3. > git add filename (or) > git add * (for all files to add)
4.4. > git commit -m "commiting message"
4.5. > git status - We can check git status anywhere to track.
here, git creates a connector to connect with outside(server) called remote.
using above command it create a remote called origin.
git -v remote
To see the remotes added
git remote remove origin
To remove origin remote
To push the code
git push origin master (If you are doing very first push)
here, it tells to push the code from master(i.e in local branch) to
the remote named Origin(which reflects at remote server- github)
If we want to push changes later with some modification through branch
git checkout -b branchName
Creates a branch with branchName and checkouts to the same
now add and commit files
git push origin branchName
This creates a branch on git repo and we can verify and create a pull request and then can merge the pull request to master branch through github portal
Open Git Bash
To know the Git version
To add user Git access
To add local repository of git 4.1. Open git bash in the project folder (Make a directory using 'cd path' or 'cd -' [for previous path] or 'cd /' - [for into root directory])
4.2. > git init - use within directory: to start git intilization locally. 4.3. > git add filename (or) > git add * (for all files to add) 4.4. > git commit -m "commiting message" 4.5. > git status - We can check git status anywhere to track.
To add remote repository
To push the code
If we want to push changes later with some modification through branch
now add and commit files
git push origin branchName