Git and GitHub...
Rakesh Kumar
Test engineer|Deployment|HSS| HLR| IMS| 5G| SIP| SDP|HTTP2|PFCP|Diameter protocol|IMS Deployment| Docker &Kubernetes|
Login aws account----> create two EC2 instance
Commands:-
How to commit, push & pull from GitHub:-
Practical scenario with aws account:
create two instance (machine) in two region (Mumbai & another in Singapore)
Same process we have to do on another region EC2 instance.
or.. now go to Singapore EC2 instance create one directory and go inside it.
and run command mentioned below...
Now add some code in the file and do the below process.
Ignore Some Files:-
To ignore some files while commit. create one hidden file .gitignore and enter file format which you want to ignore.
for example:
vi .gitignore
enter{*.css
*.java
create some text, java & css files and add them by running "git add"
Branch:
#The diagram above visualizes a repository with more than one isolated lines of developments. One for a small features and one for big feature, by developing them in parallel but it also keeps the main master branch free from error.
领英推荐
Commands:
o/p--> master ( means current branch)
Merge:
Git conflict:
when some file having different content in different branches, if you want to merge then conflict occurs(resolve conflict then add and commit)
Git stashing:
Suppose you are implementing a new feature for your product. your code is in progress and suddenly a customer escalation comes because of this you have to keep aside your new feature work for few hours.
you can't commit your partial code and also can not throw away your changes, so you need some temporary storage, when you can store your partial changes and later on commit it.
to stash an item (only applies to modified files not new files)
Commands:
git status # to stash an item
git stash list # to see stashed item list
Git reset:
git reset is a powerful command that is used to undo local changes to the state of git repo
To reset staging area
git reset <file name>
git reset. # reset all files
To reset the changes from both staging area and working directory at a time.
git reset --hard