- Create Repository
- Git init
- Clone Repository
- Git clone <repository path”
- Add files to repository
- Add specific file
git add <filepath>
- Add multipe files git
Git add <file1path> <file2path>
- Add all the files
Git add -A
git add .
- Adding modified files
- Git add -u
- Delete files
- Delete the file using OS command (rm)
- Git add -u
- Renaming files
- Renaming files using os Command (mv)
- Git add -A
- Commit changes to staging area
- git commit -m “<change log>”
- See history
- Git log
- Difference
- Difference between two commits
- git diff <commit-6char-sha1>..<commit-6char-sha1>
- Difference from current HEAD to previous version
- git diff HEAD~1..HEAD
- git diff HEAD~1..
- Moving working folder to older commit
Git checkout <commit-6char-sha1>
- Moving working folder back
Git checkout master
- Undo changes
- For a particular file
- Git checkout <fileName>
- For all the changes
- git reset --hard
- Ignoring file always under working folder
- Creating a gitignore file
- Graph and one line logs
- git log --oneline --graph
- Logs by authors and commit messages
- git shortlog
- git shortlog -sne
- Remote Name
- Git remote
- git remote -v
- Viewing branches
- git branch
- Remote branches
- Git branch -r
- Viewing Tags
- Git tag
- Adding local repository to remote
- Git remote add origin https://github.com/shaikkhajaibrahim/GitPractice.git
- Fetch changes from remote
- git fetch
- Merge changes
- git merge origin/master
- This leads to fast forward
- git commit after git status
- Git pull for fetch + merge
- Set the upstream branch for pull to work
- Git branch --set-upstreamto master=origin/master
- Create a tag
- git tag v1.0
- Pushing tags to remote
- Git push --tags
- Create local branch
- Git checkout -b “branchname”
- Commiting a local branch to remote
- git push <remote-name> <local-branch-name>:<remote-branch-name>
- For subsequent pushes
- git push -u <remote-name> <local-branch-name>
- Checkout remote branch
- Git checkout <remotebranchname>
- (git checkout ImportantFix)
- Viewing all branches
- $ git log --graph --oneline --all --decorate
Hats off to your presence of mind..I really enjoyed reading your blog. I really appreciate your information which you shared with us.
ReplyDeleteDevops Online Training
ReplyDeleteThanks for sharing such a good blog.
DevOps Training
DevOps Online Training
I just added your blog to my bookmark sites. thanks.Quality posts is the crucial to invite the visitors to visit the web page
ReplyDeleteDevOps Training in Bangalore | Certification | Online Training Course institute | DevOps Training in Hyderabad | Certification | Online Training Course institute | DevOps Training in Coimbatore | Certification | Online Training Course institute | DevOps Online Training | Certification | Devops Training Online
Sands Casino: Get a $200 Bonus with $50 Free Chip
ReplyDeleteYou'll also get up to $50 free Chip. The first sign-up 우리 계열 샌즈 카지노 bonus at Sands Casino is worth just $10.