Git
Git Commands
-----------------------------------------------------------------------------------------------------------------------------
- Create a Organizations
- Creata a Repo
- Create a Team
- Add user to the team
- Provide the Repo access to the team
git init ------------>Create a empty Git empty local repo. (Head,Branch,config,hooks )
Working Area Staging Area Local Repo
|
Employee.java |
|
Deploy.sh |
|
Users.java |
|
DBUtils.java |
git status
git commit -a -m "Enter Your message here....!" (For modified Files only...)
git remote add wallmart https://github.com/Sundupalli/wallmart.git
git remote -v
git push (alias_name) master
git log -9
git log ------------>How to know how many commits are there as of now.
git show <Commit_id> --->It will display on particular commit id how many files are commited.
git show --pretty="" --name-only <Commit_id> -------> Display only files name.
Working Area Staging Area Local Repo
Employee.java |
Deploy.sh |
Users.java |
DBUtils.java git reset <Fn_1> ======================================================================================= |
cleanup (If we badly commeit the code, remove the commited code from remote Repo.it will delete the content also.)
git revert <Commit_id>
.gitignore
What is different between git reset & git revert ? [Interview question]
git branch <custom_name>
git chekout development -------------------------------> Switch to the branch
git chekout -b <br_name>--------------------------------> It will create a new branch and checkout.
git branch -m <old_name> <new_name> ------------>Renaming the branch name
git diff <br_name>
git diff <br_name> <br_name>
git merge <br_name>
git push master development stage
git branch -r -----------------> Display Remote Branch
git branch -a -----------------> Display Local & Remote Branch
git branch -d <Branch_Name>---------------------> To delete.
git push (alias_name) :<Branch_Name>
Pull Request:--- Integrate one branch to another branch in remote repo.
Branch Tags
- Branch is Mutable 1.Tag is Immutable.
- We will create on going development 2. On producu deployment.
- Where ever we will created 3. Only on master branch
- git branch <bn> 4. git tag <tn>
- git branch 5.git tag
- git push <an><bn> 6. git push <an> tag <tn>
- git push <an> --all 7. git push <an> --tags
- git branch -d <bn> 8.git tag -d <tn>
git tag ------------------------------------------------------> display all tags
git push (alias_name) tag <tag_Name>---------> pushing into remote repo.
git push (alias_name) --tags------------------------>
git tag -d <tag_Name>--------------------------------> Delete tags.
git stash------------> if you want to jump to another branch without complete preset task.
git stash list
git stash apply
git stash drop
git stash pop ---------------------------------------> [apply + drop]
git stash apply stash{1} git stash drop stash{1}
git stash apply stash{2} git stash drop stash{2}
git cherry-pick:
git cherry-pick CID
git clone <Repo_Url>
git fetch-------------------------------> Same as above.
git pull = git fetch + git merge
git merge (alias_name) <Branch_Name>
2.Check whether is available or not on my local laptop.--------> ls -la ~/.ssh
Password less communication b/w Server to Server ? ---------(Youtube---linux video)
- Copy SSH Url from
- git remote add Aliyas_name URL
- Go to Github Setting tab.
- Developer Settings--------> Personal Access Token-------> Generate New Token.
- Copy token information.
git config --global --list
Labels: Mithun Technologies

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home